File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11import express from 'express' ;
22import graphqlHTTP from 'express-graphql' ;
3- import { GraphQLSchema , GraphQLObjectType } from 'graphql' ;
3+ import { graphql } from 'graphql-compose ' ;
44import { elasticApiFieldConfig } from '../../src' ; // from 'graphql-compose-elasticsearch';
55
6+ const { GraphQLSchema, GraphQLObjectType } = graphql ;
7+
68const expressPort = process . env . port || process . env . PORT || 9201 ;
79
810const generatedSchema = new GraphQLSchema ( {
Original file line number Diff line number Diff line change 33
44import express from 'express' ;
55import graphqlHTTP from 'express-graphql' ;
6- import { GraphQLSchema , GraphQLObjectType } from 'graphql' ;
6+ import { graphql } from 'graphql-compose ' ;
77import elasticsearch from 'elasticsearch' ;
88import { composeWithElastic , elasticApiFieldConfig } from '../../src' ; // from 'graphql-compose-elasticsearch';
99
10+ const { GraphQLSchema, GraphQLObjectType } = graphql ;
11+
1012const expressPort = process . env . port || process . env . PORT || 9201 ;
1113
1214// mapping obtained from ElasticSearch server
@@ -127,7 +129,7 @@ const server = express();
127129server . use (
128130 '/' ,
129131 graphqlHTTP ( {
130- schema : generatedSchema ,
132+ schema : ( generatedSchema : any ) ,
131133 graphiql : true ,
132134 formatError : error => ( {
133135 message : error . message ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type {
1313 GraphQLFieldConfigMap ,
1414 GraphQLFieldConfigArgumentMap ,
1515 GraphQLInputType ,
16- } from " graphql/type /definition" ; // eslint-disable-line
16+ } from ' graphql-compose/lib /definition' ; // eslint-disable-line
1717
1818const {
1919 GraphQLString,
You can’t perform that action at this time.
0 commit comments