From a143e489ae7339a698e171d8eb787bb168394b9d Mon Sep 17 00:00:00 2001 From: Tim Vandecasteele Date: Fri, 13 Jun 2025 17:56:25 +0200 Subject: [PATCH] Use the types from the superclass So if it's not needed you don't have to define the query type again. --- lib/graphql/schema/build_from_definition.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graphql/schema/build_from_definition.rb b/lib/graphql/schema/build_from_definition.rb index b5b3cc614d..c213d57481 100644 --- a/lib/graphql/schema/build_from_definition.rb +++ b/lib/graphql/schema/build_from_definition.rb @@ -51,7 +51,7 @@ def build(schema_superclass, document, default_resolve:, using: {}, base_types: raise InvalidDocumentError.new('Must provide only one schema definition.') end schema_definition = schema_defns.first - types = {} + types = schema_superclass.types.dup directives = schema_superclass.directives.dup type_resolver = build_resolve_type(types, directives, ->(type_name) { types[type_name] ||= Schema::LateBoundType.new(type_name)}) # Make a different type resolver because we need to coerce directive arguments