Skip to content

Commit

Permalink
Use introspectioFromSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Oct 27, 2021
1 parent 03b4488 commit d37b3e4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/plugin/tests/mocks/graphql-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { createServer, Server, IncomingMessage, ServerResponse } from 'http';
import { buildSchema, getIntrospectionQuery, graphqlSync } from 'graphql';
import { buildSchema, introspectionFromSchema } from 'graphql';

const sdlSchema = readFileSync(resolve(__dirname, 'user-schema.graphql'), 'utf8');
const graphqlSchemaObj = buildSchema(sdlSchema);
const introspectionQueryResult = require('graphql/package.json').version.startsWith('16')
? graphqlSync({
schema: graphqlSchemaObj,
source: getIntrospectionQuery(),
})
: graphqlSync(graphqlSchemaObj, getIntrospectionQuery());
const introspectionQueryResult = introspectionFromSchema(graphqlSchemaObj);

class TestGraphQLServer {
private server: Server;
Expand Down

0 comments on commit d37b3e4

Please sign in to comment.