graphene icon indicating copy to clipboard operation
graphene copied to clipboard

KeyError when making shallow copy of GrapheneObjectType

Open waltherlee opened this issue 4 years ago • 0 comments

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

waltherlee avatar Apr 29 '21 03:04 waltherlee