Skip to content

Instantly share code, notes, and snippets.

@lastmjs
Created March 12, 2018 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lastmjs/854815966117ac0a83cbc73e2755c747 to your computer and use it in GitHub Desktop.
Save lastmjs/854815966117ac0a83cbc73e2755c747 to your computer and use it in GitHub Desktop.
const preparedFieldResolvers = addFragmentToFieldResolvers(parse(readFileSync('./schema/datamodel.graphql').toString()), `{ id }`)
const generatedFragmentReplacements = extractFragmentReplacements(preparedFieldResolvers);
const PrismaDBConnection = new Prisma({
endpoint: 'http://127.0.0.1:4466/backend/dev', // the endpoint of the Prisma DB service
secret: 'mysecret123', // specified in database/prisma.yml //TODO obviously this should be controlled with environment variables
debug: true, // log all GraphQL queries & mutations
fragmentReplacements: generatedFragmentReplacements
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment