-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
30 lines (27 loc) · 840 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { ApolloServer } = require('apollo-server');
const typeDefs = require('./schema');
const resolvers = require('./resolvers');
const server = new ApolloServer({
typeDefs,
resolvers,
engine: {
graphVariant: 'local',
apiKey: 'service:splendor:SaDSZzGf0avhRcSqD8z_Mg',
graphVariant: process.env.NODE_ENV || 'local',
reportSchema: true,
sendHeaders: { all: true },
sendVariableValues: { all: true },
// URLs for reporting to Studio staging instead of Studio prod.
// tracesEndpointUrl: 'https://engine-staging-report.apollodata.com',
// schemaReportingUrl:
// 'https://engine-staging-graphql.apollographql.com/api/graphql',
},
playground: true,
});
server
.listen({
port: process.env.PORT || 4000,
})
.then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
});