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
{{ message }}
Repository navigation
bug: TypeError: Redefinition of reserved type 'String' - Graphql generate-return-types #713
When running infrahubctl graphql generate-return-types queries I got the following exception: Error: Redefinition of reserved type 'String'
KeyError: '__typename'
During handling of the above exception, another exception occurred:
raise TypeError(f"Redefinition of reserved type {name!r}")
TypeError: Redefinition of reserved type 'String'
Then infrahubctl graphql generate-return-types queries
=> This will fail with error described above
Remove __typename from query
Then infrahubctl graphql generate-return-types queries
=> This works
Additional Information
The __typename field is not explicitly defined in the GraphQL schema. In GraphQL, __typename is an introspection meta-field that's automatically available on all types - it doesn't need to be (and shouldn't be) explicitly defined in the schema. The problem is that ariadne-codegen is trying to look up __typename in the schema's type map and failing because it's not there (it's a built-in introspection field). When it fails to find it, it tries to create a fallback GraphQLScalarType(name="String"), but this causes the "Redefinition of reserved type 'String'" error because String is a reserved built-in scalar type in GraphQL. This is a bug in ariadne-codegen, not in your query or schema.
Activity
coderabbitai commentedon Dec 29, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Related Issues
AttributeErrorif not a valid attribute. #445👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Fix issue #713
Fix issue #713 and #712 (#714)