graphql-authentication-prisma

Prisma adapter for graphql-authentication

Usage no npm install needed!

<script type="module">
  import graphqlAuthenticationPrisma from 'https://cdn.skypack.dev/graphql-authentication-prisma';
</script>

README

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