Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Remove deprecated introspection fields #1385

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions src/type/__tests__/introspection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
23 changes: 0 additions & 23 deletions src/type/introspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}),
});

Expand Down
6 changes: 0 additions & 6 deletions src/utilities/__tests__/schemaPrinter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\`.")
}

"""
Expand Down Expand Up @@ -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
Expand Down