hez
05/23/2018, 2:31 PMnikolasburk
nikolasburk
Sam Hulick
05/23/2018, 2:49 PMnikolasburk
Sam Hulick
05/23/2018, 2:51 PMSam Hulick
05/23/2018, 2:52 PMhez
05/23/2018, 3:09 PMschema.graphql
to use for building the API, and a nodejs application that will serve it with a series of custom resolvers.
Is there a way to roll that into all of this?nikolasburk
schema.graphql
with your prisma.graphql
?hez
05/23/2018, 3:12 PMhez
05/23/2018, 3:12 PMimport { GraphQLServer, Options } from 'graphql-yoga'
import { Prisma } from 'prisma-binding'
import { resolvers } from './resolvers'
import { formatError } from 'apollo-errors'
const serverOptions: Options = {
formatError,
}
const server = new GraphQLServer({
typeDefs: './schema/schema.graphql',
resolvers,
context: (req) => ({
...req,
db: new Prisma({
typeDefs: 'generated/prisma.graphql',
endpoint: '<http://localhost:4466/services/dev>',
secret: 'ufggvyutfgt',
debug: true,
}),
}),
})
server.start(serverOptions, () =>
console.log(`Server is running on <http://localhost:4000`>),
)
hez
05/23/2018, 3:13 PMhez
05/23/2018, 3:13 PMhez
05/23/2018, 3:14 PMlocalhost:4466/services/dev
represents our locally running prisma containerhez
05/23/2018, 3:15 PMnilan
05/23/2018, 3:49 PMnilan
05/23/2018, 3:49 PMnilan
05/23/2018, 3:50 PM