Open
Description
import {Prisma} from './generated/prisma-client'
import {resolvers} from './resolvers'
import {ApolloServer} from "apollo-server";
import {importSchema} from "graphql-import";
import {GraphqlAuthenticationPrismaAdapter} from "graphql-authentication-prisma";
import {mailer} from "./utils";
const db = new Prisma({
endpoint: process.env.PRISMA_ENDPOINT!,
secret: process.env.PRISMA_SECRET!,
debug: true,
});
const graphqlAuthentication = graphqlAuthenticationConfig({
adapter: new GraphqlAuthenticationPrismaAdapter(),
secret: process.env.PRISMA_SECRET!,
requiredConfirmedEmailForLogin: true,
mailer,
mailAppUrl: 'http://example.com'
});
const server = new ApolloServer({
typeDefs: importSchema('./src/schema.graphql'),
resolvers,
introspection: true,
playground: process.env.NODE_ENV === 'development',
debug: process.env.NODE_ENV === 'development',
context: req => ({...req, db, graphqlAuthentication}),
});
server.listen({port: process.env.PORT || 4000}).then(({url}) => {
console.log(`🚀 Server ready at ${url}`);
});
How do I use the authQueries, authMutations resolvers with my other resolvers generated by graphql-resolver-codegen?
Metadata
Metadata
Assignees
Labels
No labels