Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Separate variables in subscription #330

Copy link
Copy link
@boxmein

Description

@boxmein
Issue body actions

What happens

Qminder.graphql.subscribe(query) does not accept a second, optional argument for variables.

What should happen

Qminder.graphql.subscribe(query, variables) should accept a second, optional argument variables which it passes to the GQL_START message and sends to the backend: https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md#gql_start

Why

  • It's best practice to send variables next to the query document, instead of injecting them with string interpolation
  • Prevents GraphQL injections during runtime
  • Makes writing complex or parameterized functions clearer
  • Helps utilize modern tooling such as graphql-tag which disallows string interpolation into queries
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.