Skip to content

Commit

Permalink
Use getIntrospectionQuery rather than introspectionQuery constant.
Browse files Browse the repository at this point in the history
The next major version of `graphql-js` deprecates the `introspectionQuery`
constant (thanks to graphql/graphql-js#2124) that
was previously leveraged in Apollo Client tests for obtaining the
introspection query (to be clear, this is the query used to introspect a
server, not the result of the introspection itself) in one particular test.

This deprecation isn't entirely surprising since the `getIntrospectionQuery`
utility method has existed since `[email protected]` and is the recommended way
to obtain this query in more recent versions of `graphql`, so this changes
that test to use that new method.

I discovered this while investigating our compatibility with the most
recently published `[email protected]` on `apollo-server`,
`apollo-tooling` and `apollo-client`.  Other than this, I didn't encounter
any test failures when updating the root `graphql` dev-dependency to
`[email protected]`!

Deprecated by: graphql/graphql-js#2124
In Response to: graphql/graphql-js#2303
Relates to: apollographql/apollo-server#3649
Relates to: apollographql/apollo-tooling#1743
  • Loading branch information
abernix committed Jan 3, 2020
1 parent 1b9a392 commit 4dc0217
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/local-state/general.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gql from 'graphql-tag';
import { DocumentNode, GraphQLError } from 'graphql';
import { introspectionQuery } from 'graphql/utilities';
import { getIntrospectionQuery } from 'graphql/utilities';

import { Observable } from '../../utilities/observables/Observable';
import { ApolloLink } from '../../link/core/ApolloLink';
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('General functionality', () => {

it('should not interfere with server introspection queries', () => {
const query = gql`
${introspectionQuery}
${getIntrospectionQuery()}
`;

const error = new GraphQLError('no introspection result found');
Expand Down

0 comments on commit 4dc0217

Please sign in to comment.