diff --git a/graphene/types/schema.py b/graphene/types/schema.py index 633392d9..7c48403f 100644 --- a/graphene/types/schema.py +++ b/graphene/types/schema.py @@ -453,10 +453,10 @@ class Schema: return _type def get_type(self, name): - ''' + """ This will actually return a `GraphQLObjectType` of type `GrapheneObjectType` from graphql-core, not a graphene ObjectType. These two are fundamentally different classes. That's the reason why your test is failing. You'd need to return the Graphene type here. - ''' + """ return self.graphql_schema.type_map.get(name).graphene_type def lazy(self, _type): diff --git a/graphene/types/tests/test_schema.py b/graphene/types/tests/test_schema.py index bbbead56..f67fb914 100644 --- a/graphene/types/tests/test_schema.py +++ b/graphene/types/tests/test_schema.py @@ -32,7 +32,7 @@ def test_schema_get_type(): schema = Schema(Query) assert schema.Query == Query assert schema.MyOtherType == MyOtherType - assert schema.get_type('MyOtherType') == MyOtherType + assert schema.get_type("MyOtherType") == MyOtherType