- name: with no directives rule: KnownDirectives schema: 0 query: |2- query Foo { name ...Frag } fragment Frag on Dog { name } errors: [] - name: with known directives rule: KnownDirectives schema: 0 query: |2- { dog @include(if: true) { name } human @skip(if: false) { name } } errors: [] - name: with unknown directive rule: KnownDirectives schema: 0 query: |2- { dog @unknown(directive: "value") { name } } errors: - message: Unknown directive "unknown". locations: - {line: 3, column: 13} - name: with many unknown directives rule: KnownDirectives schema: 0 query: |2- { dog @unknown(directive: "value") { name } human @unknown(directive: "value") { name pets @unknown(directive: "value") { name } } } errors: - message: Unknown directive "unknown". locations: - {line: 3, column: 13} - message: Unknown directive "unknown". locations: - {line: 6, column: 15} - message: Unknown directive "unknown". locations: - {line: 8, column: 16} - name: with well placed directives rule: KnownDirectives schema: 0 query: |2- query Foo @onQuery { name @include(if: true) ...Frag @include(if: true) skippedField @skip(if: true) ...SkippedFrag @skip(if: true) } mutation Bar @onMutation { someField } errors: [] - name: with misplaced directives rule: KnownDirectives schema: 0 query: |2- query Foo @include(if: true) { name @onQuery ...Frag @onQuery } mutation Bar @onQuery { someField } errors: - message: Directive "include" may not be used on QUERY. locations: - {line: 2, column: 17} - message: Directive "onQuery" may not be used on FIELD. locations: - {line: 3, column: 14} - message: Directive "onQuery" may not be used on FRAGMENT_SPREAD. locations: - {line: 4, column: 17} - message: Directive "onQuery" may not be used on MUTATION. locations: - {line: 7, column: 20} - name: within schema language/with well placed directives rule: KnownDirectives schema: 0 query: |2- type MyObj implements MyInterface @onObject { myField(myArg: Int @onArgumentDefinition): String @onFieldDefinition } extend type MyObj @onObject scalar MyScalar @onScalar extend scalar MyScalar @onScalar interface MyInterface @onInterface { myField(myArg: Int @onArgumentDefinition): String @onFieldDefinition } extend interface MyInterface @onInterface union MyUnion @onUnion = MyObj | Other extend union MyUnion @onUnion enum MyEnum @onEnum { MY_VALUE @onEnumValue } extend enum MyEnum @onEnum input MyInput @onInputObject { myField: Int @onInputFieldDefinition } extend input MyInput @onInputObject schema @onSchema { query: MyQuery } extend schema @onSchema errors: [] - name: within schema language/with misplaced directives rule: KnownDirectives schema: 0 query: |2- type MyObj implements MyInterface @onInterface { myField(myArg: Int @onInputFieldDefinition): String @onInputFieldDefinition } scalar MyScalar @onEnum interface MyInterface @onObject { myField(myArg: Int @onInputFieldDefinition): String @onInputFieldDefinition } union MyUnion @onEnumValue = MyObj | Other enum MyEnum @onScalar { MY_VALUE @onUnion } input MyInput @onEnum { myField: Int @onArgumentDefinition } schema @onObject { query: MyQuery } extend schema @onObject errors: - message: Directive "onInterface" may not be used on OBJECT. locations: - {line: 2, column: 43} - message: Directive "onInputFieldDefinition" may not be used on ARGUMENT_DEFINITION. locations: - {line: 3, column: 30} - message: Directive "onInputFieldDefinition" may not be used on FIELD_DEFINITION. locations: - {line: 3, column: 63} - message: Directive "onEnum" may not be used on SCALAR. locations: - {line: 6, column: 25} - message: Directive "onObject" may not be used on INTERFACE. locations: - {line: 8, column: 31} - message: Directive "onInputFieldDefinition" may not be used on ARGUMENT_DEFINITION. locations: - {line: 9, column: 30} - message: Directive "onInputFieldDefinition" may not be used on FIELD_DEFINITION. locations: - {line: 9, column: 63} - message: Directive "onEnumValue" may not be used on UNION. locations: - {line: 12, column: 23} - message: Directive "onScalar" may not be used on ENUM. locations: - {line: 14, column: 21} - message: Directive "onUnion" may not be used on ENUM_VALUE. locations: - {line: 15, column: 20} - message: Directive "onEnum" may not be used on INPUT_OBJECT. locations: - {line: 18, column: 23} - message: Directive "onArgumentDefinition" may not be used on INPUT_FIELD_DEFINITION. locations: - {line: 19, column: 24} - message: Directive "onObject" may not be used on SCHEMA. locations: - {line: 22, column: 16} - message: Directive "onObject" may not be used on SCHEMA. locations: - {line: 26, column: 23}