graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Validate that a subscription query only contains 1 field

Open jkimbo opened this issue 5 years ago • 0 comments

The way that GraphQL-core implements subscriptions means that if you make a subscription query with more than 1 field in it only the resolver for the first field will be called. See: graphql-python/graphql-core@3267c4c/src/graphql/subscription/subscribe.py#L147-L151

There should be some validation on the subscribe method on the Schema class to make sure that 1 field is only ever passed to a subscription query to prevent confusion.

See https://github.com/graphql-python/graphene/pull/1107#issuecomment-657194024

jkimbo avatar Jul 12 '20 12:07 jkimbo