Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/graphql-java-kickstart#407' into g…
Browse files Browse the repository at this point in the history
…raphql-java-kickstart#407

# Conflicts:
#	src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt
#	src/test/groovy/graphql/kickstart/tools/FieldResolverScannerSpec.groovy
  • Loading branch information
KammererTob committed Jul 12, 2020
2 parents 0e99154 + 8e966d7 commit 8748503
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/groovy/graphql/kickstart/tools/BaseDevice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package graphql.kickstart.tools;

public interface BaseDevice {
BaseMeta getMeta();
}
3 changes: 3 additions & 0 deletions src/test/groovy/graphql/kickstart/tools/BaseMeta.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package graphql.kickstart.tools;

public interface BaseMeta {}
44 changes: 44 additions & 0 deletions src/test/groovy/graphql/kickstart/tools/SchemaParserSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,50 @@ class SchemaParserSpec extends Specification {
noExceptionThrown()
}

def "allow circular relations in input objects"() {
when:
SchemaParser.newParser().schemaString('''\
input A {
id: ID!
b: B
}
input B {
id: ID!
a: A
}
input C {
id: ID!
c: C
}
type Query {}
type Mutation {
test(input: A!): Boolean
testC(input: C!): Boolean
}
'''.stripIndent())
.resolvers(new GraphQLMutationResolver() {
static class A {
String id;
B b;
}
static class B {
String id;
A a;
}
static class C {
String id;
C c;
}
boolean test(A a) { return true }
boolean testC(C c) { return true }
}, new GraphQLQueryResolver() {})
.build()
.makeExecutableSchema()

then:
noExceptionThrown()
}

enum EnumType {
TEST
}
Expand Down

0 comments on commit 8748503

Please sign in to comment.