Repository navigation
Closed
Labels
type: bugAn issue or pull request relating to a bug
Description
The gql pre-release version is not working with the latest graphql-core version (3.3.0a12), the DSL code is not working anymore, which also means that any code fetching the schema from the backend will not work since we are now using the DSL code to generate the introspection query.
tests are failing with:
ERROR tests/starwars/test_dsl.py - TypeError: InlineFragmentNode.__init__() missing 1 required keyword-only argument: 'selection_set'
mypy errors showing the problems:
gql/utilities/parse_result.py:127: error: Property "name" defined in "OperationDefinitionNode" is read-only [misc]
gql/utilities/parse_result.py:241: error: Argument "selections" to "SelectionSetNode" has incompatible type "list[FieldNode]"; expected "tuple[SelectionNode, ...]" [arg-type]
gql/dsl.py:436: error: Argument "value" to "ArgumentNode" has incompatible type "ValueNode | None"; expected "ValueNode" [arg-type]
gql/dsl.py:599: error: Property "alias" defined in "FieldNode" is read-only [misc]
gql/dsl.py:670: error: Property "selections" defined in "SelectionSetNode" is read-only [misc]
gql/dsl.py:802: error: Argument 4 to "OperationDefinitionNode" has incompatible type "**dict[str, NameNode]"; expected "Location | None" [arg-type]
gql/dsl.py:860: error: Argument "type" to "NonNullTypeNode" has incompatible type "TypeNode"; expected "NamedTypeNode | ListTypeNode" [arg-type]
gql/dsl.py:927: error: Argument "type" to "VariableDefinitionNode" has incompatible type "TypeNode | None"; expected "TypeNode" [arg-type]
gql/dsl.py:934: error: Argument "directives" to "VariableDefinitionNode" has incompatible type "tuple[DirectiveNode, ...]"; expected "tuple[ConstDirectiveNode, ...]" [arg-type]
gql/dsl.py:1144: error: Property "arguments" defined in "FieldNode" is read-only [misc]
gql/dsl.py:1147: error: Argument "value" to "ArgumentNode" has incompatible type "ValueNode | None"; expected "ValueNode" [arg-type]
gql/dsl.py:1178: error: Property "selection_set" defined in "FieldNode" is read-only [misc]
gql/dsl.py:1185: error: Property "directives" defined in "FieldNode" is read-only [misc]
gql/dsl.py:1257: error: Missing named argument "selection_set" for "InlineFragmentNode" [call-arg]
gql/dsl.py:1269: error: Property "selection_set" defined in "InlineFragmentNode" is read-only [misc]
gql/dsl.py:1277: error: Property "type_condition" defined in "InlineFragmentNode" is read-only [misc]
gql/dsl.py:1288: error: Property "directives" defined in "InlineFragmentNode" is read-only [misc]
gql/dsl.py:1341: error: Property "directives" defined in "FragmentSpreadNode" is read-only [misc]
gql/dsl.py:1385: error: Property "value" defined in "NameNode" is read-only [misc]
gql/dsl.py:1455: error: Argument 3 to "FragmentDefinitionNode" has incompatible type "**dict[str, tuple[VariableDefinitionNode, ...]]"; expected "Location | None" [arg-type]
gql/dsl.py:1519: error: Argument "definitions" to "DocumentNode" has incompatible type "list[Any]"; expected "tuple[DefinitionNode, ...]" [arg-type]
Workaround: pin graphql-core to 3.3.0a11
Metadata
Metadata
Assignees
Labels
type: bugAn issue or pull request relating to a bug
Activity
Cito commentedon Mar 31, 2026
The AST module hast been optimized in this version to improve performance. This is intentional and the read-only types are in line with the typing in GraphQL.js upstream. Can you adapt in GQL?
Note that GraphQL-core 3.3 is still an alpha release, and AST is a low-level API. Breaking changes are rare, but can happen.
leszekhanusz commentedon Mar 31, 2026
That won't be easy, the whole point of the DSL code in GQL is to progressively modify the AST programmatically. I suppose we'll have to save the whole structure in the classes in GQL and only create the graphql-core classes at the end.
Cito commentedon Mar 31, 2026
That would be probably the best. The AST nodes are supposed to be immutable.