Skip to content

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

Description

@spakanati

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions