-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathIssue1847.groovy
More file actions
42 lines (33 loc) · 1.2 KB
/
Issue1847.groovy
File metadata and controls
42 lines (33 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package graphql
import spock.lang.Specification
class Issue1847 extends Specification {
def schema = TestUtil.schema('''
type Query {
listWithCircularReference(filter : TypeWithCircularReference) : String
list(filter : Type) : String
}
input TypeWithCircularReference {
circularField : TypeWithCircularReference
}
input Type {
field: String
}
''')
def "#1847 when there is a circular reference between Input Type and Input Field - not StackOverflowError"() {
when:
def type = schema.getType("TypeWithCircularReference")
def string = type.toString()
println(string)
then:
string.contains("[GraphQLInputObjectType]")
}
def "#1847 when there is no circular reference between Input Type and Input Field - toString returns all data"() {
when:
def type = schema.getType("Type")
def string = type.toString()
println(string)
then:
!string.contains("[GraphQLInputObjectType]")
string.contains("GraphQLScalarType")
}
}