Skip to content

Commit e60fb5a

Browse files
committed
fixing tests
1 parent d601754 commit e60fb5a

2 files changed

Lines changed: 56 additions & 2 deletions

File tree

src/test/groovy/graphql/schema/idl/SchemaPrinterTest.groovy

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,23 @@ type Query {
801801

802802
def idlWithDirectives() {
803803
return """
804+
directive @interfaceFieldDirective on FIELD_DEFINITION
805+
directive @unionTypeDirective on UNION
806+
directive @query1 on OBJECT
807+
directive @query2(arg1: String) on OBJECT
808+
directive @fieldDirective1 on FIELD_DEFINITION
809+
directive @fieldDirective2(argStr: String, argInt: Int, argFloat: Float, argBool: Boolean) on FIELD_DEFINITION
810+
directive @argDirective on ARGUMENT_DEFINITION
811+
directive @interfaceImplementingTypeDirective on OBJECT
812+
directive @enumTypeDirective on ENUM
813+
directive @single on OBJECT
814+
directive @singleField on FIELD_DEFINITION
815+
directive @interfaceImplementingFieldDirective on FIELD_DEFINITION
816+
directive @enumValueDirective on ENUM_VALUE
817+
directive @inputTypeDirective on INPUT_OBJECT
818+
directive @inputFieldDirective on INPUT_FIELD_DEFINITION
819+
directive @interfaceTypeDirective on INTERFACE
820+
directive @scalarDirective on SCALAR
804821
805822
interface SomeInterface @interfaceTypeDirective {
806823
fieldA : String @interfaceFieldDirective
@@ -866,6 +883,40 @@ directive @skip(
866883
if: Boolean!
867884
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
868885
886+
directive @interfaceFieldDirective on FIELD_DEFINITION
887+
888+
directive @unionTypeDirective on UNION
889+
890+
directive @query1 on OBJECT
891+
892+
directive @query2(arg1: String) on OBJECT
893+
894+
directive @fieldDirective1 on FIELD_DEFINITION
895+
896+
directive @fieldDirective2(argBool: Boolean, argFloat: Float, argInt: Int, argStr: String) on FIELD_DEFINITION
897+
898+
directive @argDirective on ARGUMENT_DEFINITION
899+
900+
directive @interfaceImplementingTypeDirective on OBJECT
901+
902+
directive @enumTypeDirective on ENUM
903+
904+
directive @single on OBJECT
905+
906+
directive @singleField on FIELD_DEFINITION
907+
908+
directive @interfaceImplementingFieldDirective on FIELD_DEFINITION
909+
910+
directive @enumValueDirective on ENUM_VALUE
911+
912+
directive @inputTypeDirective on INPUT_OBJECT
913+
914+
directive @inputFieldDirective on INPUT_FIELD_DEFINITION
915+
916+
directive @interfaceTypeDirective on INTERFACE
917+
918+
directive @scalarDirective on SCALAR
919+
869920
"Marks the field or enum value as deprecated"
870921
directive @deprecated(
871922
"The reason for the deprecation"
@@ -1088,6 +1139,7 @@ type Query {
10881139

10891140
def "can print a schema as AST elements"() {
10901141
def sdl = '''
1142+
directive @directive1 on SCALAR
10911143
type Query {
10921144
foo : String
10931145
}
@@ -1197,6 +1249,8 @@ directive @skip(
11971249
if: Boolean!
11981250
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
11991251
1252+
directive @directive1 on SCALAR
1253+
12001254
"Marks the field or enum value as deprecated"
12011255
directive @deprecated(
12021256
"The reason for the deprecation"

src/test/groovy/graphql/schema/transform/FieldVisibilitySchemaTransformationTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ class FieldVisibilitySchemaTransformationTest extends Specification {
736736
given:
737737
GraphQLSchema schema = TestUtil.schema("""
738738
739-
directive @private on FIELD_DEFINITION
739+
directive @private on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
740740
741741
type Query {
742742
foo: Foo
@@ -774,7 +774,7 @@ class FieldVisibilitySchemaTransformationTest extends Specification {
774774
given:
775775
GraphQLSchema schema = TestUtil.schema("""
776776
777-
directive @private on FIELD_DEFINITION
777+
directive @private on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
778778
779779
type Query {
780780
foo: Foo

0 commit comments

Comments
 (0)