File tree Expand file tree Collapse file tree 1 file changed +4
-27
lines changed Expand file tree Collapse file tree 1 file changed +4
-27
lines changed Original file line number Diff line number Diff line change 2
2
import typeDefs from "./typeDefs" ;
3
3
import resolvers from "./resolvers" ;
4
4
import { rateLimit } from "../utils" ;
5
- import {
6
- makeExecutableSchema ,
7
- makeRemoteExecutableSchema ,
8
- introspectSchema ,
9
- mergeSchemas
10
- } from "graphql-tools" ;
11
- import fetch from "node-fetch" ;
12
- import { HttpLink } from "apollo-link-http" ;
13
-
14
- const uri = process . env . X_HASURA_URL ;
15
- const headers = {
16
- "x-hasura-admin-secret" : process . env . X_HASURA_ADMIN_SECRET
17
- } ;
18
-
19
- const link = new HttpLink ( {
20
- uri,
21
- headers,
22
- fetch
23
- } ) ;
5
+ import { makeExecutableSchema , mergeSchemas } from "graphql-tools" ;
24
6
25
7
export default async ( ) => {
26
- const remoteSchema = makeRemoteExecutableSchema ( {
27
- schema : await introspectSchema ( link ) ,
28
- link
29
- } ) ;
30
-
31
8
const localSchema = makeExecutableSchema ( {
32
9
typeDefs,
33
10
resolvers,
34
11
schemaDirectives : {
35
- rateLimit
36
- }
12
+ rateLimit,
13
+ } ,
37
14
} ) ;
38
15
39
16
const schema = mergeSchemas ( {
40
- schemas : [ remoteSchema , localSchema ]
17
+ schemas : [ localSchema ] ,
41
18
} ) ;
42
19
43
20
return schema ;
You can’t perform that action at this time.
0 commit comments