0.1.5 • Published 6 years ago

graphql-authentication-prisma v0.1.5

Weekly downloads
41
License
ISC
Repository
github
Last release
6 years ago

GraphQL Authentication Prisma

A Prisma adapter for Graphql Authentication.

Install

Node v8+ should be used. Install with Yarn or npm:

yarn add graphql-authentication graphql-authentication-prisma email-templates
npm i graphql-authentication graphql-authentication-prisma email-templates

Usage with Prisma

You can read the guide below or checkout the example to see the full code.

Step 1

Read the Usage section in the full documentation first.

Step 2

After configuring the basics, you can now add this package as an adapter. Pseudo-code example:

import { GraphqlAuthenticationPrismaAdapter } from 'graphql-authentication-prisma';

graphqlAuthentication: graphqlAuthenticationConfig({
  adapter: new GraphqlAuthenticationPrismaAdapter({
    // Optional, defaults to 'db'
    prismaContextName: 'db'
  })
});

Step 3

In your Prisma datamodel.graphql file, add this User model. Run prisma deploy to run the migrations.

Full Documentation