Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 144
Closed
Description
It seems like if you have a GraphQLSchema containing a directive definition that has an argument that is an enum, trying to deepcopy it results in a TypeError:
Python3.10.5 (tags/v3.10.5:f377153, Jun62022, 16:14:13) [MSCv.192964bit (AMD64)] onwin32Type"help", "copyright", "credits"or"license"formoreinformation. >>>fromcopyimportdeepcopy>>>fromgraphqlimportbuild_schema>>>schema_text="""... directive @testDirective(enumArg: TestEnum) on FIELD_DEFINITION...... enum TestEnum{... FIRST... SECOND... }...... type TestType{... field: String @testDirective(enumArg: FIRST)... }... """>>>schema=build_schema(schema_text) >>>deepcopy(schema) Traceback (mostrecentcalllast): File"<stdin>", line1, in<module>File"C:\Program Files\Python310\lib\copy.py", line153, indeepcopyy=copier(memo) File"C:\test\.venv\lib\site-packages\graphql\type\schema.py", line329, in__deepcopy__returnself.__class__( File"C:\test\.venv\lib\site-packages\graphql\type\schema.py", line258, in__init__raiseTypeError( TypeError: Schemamustcontainuniquelynamedtypesbutcontainsmultipletypesnamed'TestEnum'.Using graphql-core version 3.2.3.
twavv
Metadata
Metadata
Assignees
Labels
No labels