Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nhost gql link uses websocketlink incorrectly for queries that appear in a document that also has subscriptions #115

Open
spakanati opened this issue Sep 1, 2023 · 0 comments

Comments

@spakanati
Copy link
Contributor

Nhost's gql link implementation incorrectly uses a websocket link for a query operation if it appears in a document that also has a subscription due to this logic.

E.g. if you have a file like items.gql:

query getItem {
...
}

subscription subscribeItem(
...
}

In this case, nhost will incorrectly consider the getItem query to be a subscription and try to use a websocket link.

This can hopefully be fixed by using the extension available in newer versions of gql_exec (getOperationType is available in 1.0.0 and newer but nhost_dart is pinned on a lot of older gql packages.

Note that graphql-flutter's implementation only considers the correct operation name and discards the other operations.

@onehassan onehassan reopened this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants