From 9e4eea99c3344c4c3a3cbcbefc224b4ebe07d902 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Tue, 11 May 2021 16:48:17 -0400 Subject: [PATCH] Allow directive argument types to be LateBoundTypes --- lib/graphql/schema/build_from_definition.rb | 2 +- spec/graphql/schema/build_from_definition_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 }