Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Aug 30, 2021
1 parent c097d4f commit 0d45656
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/generator/models/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ export function prismaFieldToNexusResolver(

const result: unknown = findUnique({
where: buildWhereUniqueInput(root, uniqueIdentifiers),
/**
*
* The user might have configured Prisma Client globally to rejectOnNotFound.
* In the context of this Nexus Prisma managed resolver, we don't want that setting to
* be a behavioural factor. Instead, Nexus Prisma has its own documented rules about the logic
* it uses to project nullability from the database to the api.
*
* More details about this design can be found in the README.
*
* References:
*
* - https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#rejectonnotfound
*/
rejectOnNotFound: false,
})

// @ts-expect-error Only known at runtime
Expand Down

0 comments on commit 0d45656

Please sign in to comment.