diff --git a/src/type/__tests__/introspection-test.js b/src/type/__tests__/introspection-test.js index b7970e4f06..2d52922c5d 100644 --- a/src/type/__tests__/introspection-test.js +++ b/src/type/__tests__/introspection-test.js @@ -698,51 +698,6 @@ describe('Introspection', () => { isDeprecated: false, deprecationReason: null, }, - { - name: 'onOperation', - args: [], - type: { - kind: 'NON_NULL', - name: null, - ofType: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, - }, - }, - isDeprecated: true, - deprecationReason: 'Use `locations`.', - }, - { - name: 'onFragment', - args: [], - type: { - kind: 'NON_NULL', - name: null, - ofType: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, - }, - }, - isDeprecated: true, - deprecationReason: 'Use `locations`.', - }, - { - name: 'onField', - args: [], - type: { - kind: 'NON_NULL', - name: null, - ofType: { - kind: 'SCALAR', - name: 'Boolean', - ofType: null, - }, - }, - isDeprecated: true, - deprecationReason: 'Use `locations`.', - }, ], inputFields: null, interfaces: [], diff --git a/src/type/introspection.js b/src/type/introspection.js index e3787ba9e0..28c3de4029 100644 --- a/src/type/introspection.js +++ b/src/type/introspection.js @@ -100,29 +100,6 @@ export const __Directive = new GraphQLObjectType({ type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))), resolve: directive => directive.args || [], }, - // NOTE: the following three fields are deprecated and are no longer part - // of the GraphQL specification. - onOperation: { - deprecationReason: 'Use `locations`.', - type: GraphQLNonNull(GraphQLBoolean), - resolve: d => - d.locations.indexOf(DirectiveLocation.QUERY) !== -1 || - d.locations.indexOf(DirectiveLocation.MUTATION) !== -1 || - d.locations.indexOf(DirectiveLocation.SUBSCRIPTION) !== -1, - }, - onFragment: { - deprecationReason: 'Use `locations`.', - type: GraphQLNonNull(GraphQLBoolean), - resolve: d => - d.locations.indexOf(DirectiveLocation.FRAGMENT_SPREAD) !== -1 || - d.locations.indexOf(DirectiveLocation.INLINE_FRAGMENT) !== -1 || - d.locations.indexOf(DirectiveLocation.FRAGMENT_DEFINITION) !== -1, - }, - onField: { - deprecationReason: 'Use `locations`.', - type: GraphQLNonNull(GraphQLBoolean), - resolve: d => d.locations.indexOf(DirectiveLocation.FIELD) !== -1, - }, }), }); diff --git a/src/utilities/__tests__/schemaPrinter-test.js b/src/utilities/__tests__/schemaPrinter-test.js index 66c8baabf5..de0e4e1129 100644 --- a/src/utilities/__tests__/schemaPrinter-test.js +++ b/src/utilities/__tests__/schemaPrinter-test.js @@ -648,9 +648,6 @@ describe('Type System Printer', () => { description: String locations: [__DirectiveLocation!]! args: [__InputValue!]! - onOperation: Boolean! @deprecated(reason: "Use \`locations\`.") - onFragment: Boolean! @deprecated(reason: "Use \`locations\`.") - onField: Boolean! @deprecated(reason: "Use \`locations\`.") } """ @@ -881,9 +878,6 @@ describe('Type System Printer', () => { description: String locations: [__DirectiveLocation!]! args: [__InputValue!]! - onOperation: Boolean! @deprecated(reason: "Use \`locations\`.") - onFragment: Boolean! @deprecated(reason: "Use \`locations\`.") - onField: Boolean! @deprecated(reason: "Use \`locations\`.") } # A Directive can be adjacent to many parts of the GraphQL language, a