-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
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-tagwhich disallows string interpolation into queries