diff --git a/lib/graphql/schema/build_from_definition.rb b/lib/graphql/schema/build_from_definition.rb index 373c457e96..d9b639407e 100644 --- a/lib/graphql/schema/build_from_definition.rb +++ b/lib/graphql/schema/build_from_definition.rb @@ -50,7 +50,7 @@ def build(document, default_resolve:, using: {}, relay:) directive_type_resolver = build_resolve_type(GraphQL::Schema::BUILT_IN_TYPES, directives, ->(type_name) { types[type_name] ||= begin defn = document.definitions.find { |d| d.respond_to?(:name) && d.name == type_name } - build_definition_from_node(defn, directive_type_resolver, default_resolve) + build_definition_from_node(defn, type_resolver, default_resolve) end }) diff --git a/spec/graphql/schema/build_from_definition_spec.rb b/spec/graphql/schema/build_from_definition_spec.rb index 9c805b11d0..993360065b 100644 --- a/spec/graphql/schema/build_from_definition_spec.rb +++ b/spec/graphql/schema/build_from_definition_spec.rb @@ -130,6 +130,10 @@ def assert_schema_and_compare_output(definition) directive @foo(arg: InputA) on FIELD +type Hello { + int: Int +} + input InputA { value: InputB }