File tree 3 files changed +8
-4
lines changed 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
import express from 'express' ;
2
2
import graphqlHTTP from 'express-graphql' ;
3
- import { GraphQLSchema , GraphQLObjectType } from 'graphql' ;
3
+ import { graphql } from 'graphql-compose ' ;
4
4
import { elasticApiFieldConfig } from '../../src' ; // from 'graphql-compose-elasticsearch';
5
5
6
+ const { GraphQLSchema, GraphQLObjectType } = graphql ;
7
+
6
8
const expressPort = process . env . port || process . env . PORT || 9201 ;
7
9
8
10
const generatedSchema = new GraphQLSchema ( {
Original file line number Diff line number Diff line change 3
3
4
4
import express from 'express' ;
5
5
import graphqlHTTP from 'express-graphql' ;
6
- import { GraphQLSchema , GraphQLObjectType } from 'graphql' ;
6
+ import { graphql } from 'graphql-compose ' ;
7
7
import elasticsearch from 'elasticsearch' ;
8
8
import { composeWithElastic , elasticApiFieldConfig } from '../../src' ; // from 'graphql-compose-elasticsearch';
9
9
10
+ const { GraphQLSchema, GraphQLObjectType } = graphql ;
11
+
10
12
const expressPort = process . env . port || process . env . PORT || 9201 ;
11
13
12
14
// mapping obtained from ElasticSearch server
@@ -127,7 +129,7 @@ const server = express();
127
129
server . use (
128
130
'/' ,
129
131
graphqlHTTP ( {
130
- schema : generatedSchema ,
132
+ schema : ( generatedSchema : any ) ,
131
133
graphiql : true ,
132
134
formatError : error => ( {
133
135
message : error . message ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type {
13
13
GraphQLFieldConfigMap ,
14
14
GraphQLFieldConfigArgumentMap ,
15
15
GraphQLInputType ,
16
- } from " graphql/type /definition" ; // eslint-disable-line
16
+ } from ' graphql-compose/lib /definition' ; // eslint-disable-line
17
17
18
18
const {
19
19
GraphQLString,
You can’t perform that action at this time.
0 commit comments