You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GraphQL.js which we want to replicate it has the type ReadOnlyArray. Tuples are immutable and therefore a good fit in Python. The intention is that this list should not be accidentally mutated.
Maybe using a subclass of list that is immutable would be better. I'm thinking about it.
Meanwhile, you can pass the directives to the schema as list(specified_directives) + [custom_directives] or as specified_directives + tuple(custom_directives) or as [*specified_directives, *custom_directives].
https://github.com/graphql-python/graphql-core-next/blob/b0fa058bacf3913d0af9a75289e241f343c3842a/graphql/type/directives.py#L169
Hi, I'm new to GraphQL and have a quick question. I want to add a custom directive to the default directives including skip and included.
schema = GraphQLSchema(query, directives=specified_directives + [custom_directives])
However, the following TypeError occurs:
can only concatenate tuple (not "list") to tuple
I noticed that graph-core returns a list of these predefined directives, but graph-core-next returns a tuple. Is there a reason for this?
The text was updated successfully, but these errors were encountered: