Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError when making shallow copy of GrapheneObjectType #1333

Closed
wallee94 opened this issue Apr 29, 2021 · 0 comments · Fixed by #1463
Closed

KeyError when making shallow copy of GrapheneObjectType #1333

wallee94 opened this issue Apr 29, 2021 · 0 comments · Fixed by #1463
Labels

Comments

@wallee94
Copy link

wallee94 commented Apr 29, 2021

Making shallow copies of GrapheneObjectType using copy.copy raises KeyError: 'graphene_type'

import graphene
import copy

class Query(graphene.ObjectType):
    users = graphene.List(graphene.String)

    def resolve_users(self, info):
        return []

schema = graphene.Schema(query=Query)
copy.copy(schema.graphql_schema.query_type)  # this line raises KeyError

This was tested using graphene==3.0b7 with python 3.8, and it's not happening in graphene<3

keu210 pushed a commit to keu210/graphene that referenced this issue Sep 30, 2022
Fixes graphql-python#1333

First found when using  with a Django project. Django's  tries to create a copy of a GrapheneGraphQLType and raises this KeyError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant