Skip to content

Commit 318f0e1

Browse files
committed
fix prisma example not working
1 parent 44670e5 commit 318f0e1

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

packages/graphql-authentication-prisma/example/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const server = new GraphQLServer({
3939
endpoint: 'http://localhost:4466',
4040
debug: true
4141
}),
42-
graphqlUser: graphqlAuthenticationConfig({
42+
graphqlAuthentication: graphqlAuthenticationConfig({
4343
adapter: new GraphqlAuthenticationPrismaAdapter(),
4444
secret: 'wherearemyshoes',
4545
mailer,

packages/graphql-authentication-prisma/example/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# import Query.*, Mutation.* from "../schema.graphql"
1+
# import Query.*, Mutation.* from "../../../node_modules/graphql-authentication/schema.graphql"
22

33
type Query {
44
timeline: [Post!]!

packages/graphql-authentication-prisma/src/Prisma.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export class GraphqlAuthenticationPrismaAdapter
55
implements GraphqlAuthenticationAdapter {
66
prismaContextName = 'db';
77

8-
constructor(options: { prismaContextName?: string }) {
9-
if (options.prismaContextName) {
8+
constructor(options: { prismaContextName?: string } = {}) {
9+
if (options && options.prismaContextName) {
1010
this.prismaContextName = options.prismaContextName;
1111
}
1212
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "../../tsconfig.json"
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"strictFunctionTypes": false
5+
}
36
}

0 commit comments

Comments
 (0)