File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/test/groovy/graphql/parser Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -548,6 +548,30 @@ input Gun {
548548 extTypeDef. getFieldDefinitions(). size() == 1
549549 }
550550
551+ def " empty type definition with body" () {
552+
553+ def input = """
554+ type EmptyType {
555+
556+ }
557+
558+ extend type EmptyType {
559+ hero : String
560+ }
561+ """
562+ when :
563+ def document = new Parser (). parseDocument(input)
564+
565+ then :
566+ ObjectTypeDefinition typeDef = document. definitions[0 ] as ObjectTypeDefinition
567+ typeDef. getName() == ' EmptyType'
568+ typeDef. getFieldDefinitions(). isEmpty()
569+
570+ ObjectTypeExtensionDefinition extTypeDef = document. definitions[1 ] as ObjectTypeExtensionDefinition
571+ extTypeDef. getName() == ' EmptyType'
572+ extTypeDef. getFieldDefinitions(). size() == 1
573+ }
574+
551575 def " type implements can have & character for extra names" () {
552576
553577 def input = """
You can’t perform that action at this time.
0 commit comments