kensho-technologies/graphql-compiler

Upgrade to GraphQL-core v3 as soon as it is available; drop Python 2.x support

Closed this issue · 5 comments

This is a blocker for our 2.0 release:
graphql-python/graphql-core#53

GraphQL-core v3 does not allow for multiple directives in the same field in a query. In other words this query is invalid:

{
     ObjectType {
           field @directive1 @directive2
     }
}

We need to change tests/documentation/other code to adjust for this change.

In your example, did you mean to make the directives be differently-named, directive1 and directive2? If I understand this correctly, you are saying that a field may only have up to one directive?

I am just saying that this issue #346 is a blocker. While GraphQL-core does not enforce directive uniqueness peer location, GraphQL-core-next does.

Directives of different names are allowed to be in the same location by the GraphQL spec, see the link in #346. GraphQL-core-next additionally supports repeatable directives, which we should make use of to avoid breaking existing queries: https://github.com/graphql-python/graphql-core-next/blob/0832f0a73d60e8954f1defb7a397ff02cc7621e4/tests/validation/test_unique_directives_per_location.py#L16