-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (26 loc) · 710 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
31
32
33
// simple try:catch promise
try {
console.debug("threed index.js loaded")
const doBootApollo = true
if (doBootApollo) {
const { ApolloServer } = require('apollo-server')
const gql = require('graphql-tag')
const typeDefs = gql`
type Query {
word: String
}
`
const resolvers = {
Query: {
word: () => "HEY HEY HEY"
}
}
const schema = new ApolloServer({ typeDefs, resolvers })
schema.listen({ port: process.env.PORT }).then(({ url }) => {
console.debug(`schema ready at ${url}`)
})
}
} catch (err) {
// an error has occurred. no output is being attempted here.
console.debug("threed index.js not loaded", err)
}