Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions spec/graphql/schema/build_from_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,32 @@ def assert_schema_and_compare_output(definition)
assert_schema_and_compare_output(schema.chop)
end

it 'can build a schema with directives whose inputs have a cycle' do
schema = <<-SCHEMA
schema {
query: Hello
}

directive @foo(arg: InputA) on FIELD

input InputA {
value: InputB
}

input InputB {
value: InputA
}
SCHEMA

parsed_schema = GraphQL::Schema.from_definition(schema)
assert_equal ["deprecated", "foo", "include", "skip"], parsed_schema.directives.keys.sort
parsed_schema.directives.values.each do |dir_class|
assert dir_class < GraphQL::Schema::Directive
end

assert_schema_and_compare_output(schema.chop)
end

it 'supports descriptions and definition_line' do
schema = <<-SCHEMA
schema {
Expand Down