nexus-prisma
nexus-prisma copied to clipboard
fix: falsy uniqueIdentifierFields causing an exception
This pull request addresses a critical issue where uniqueIdentifierFields containing a falsy values cause an exception.
BTW: adding the following eslint rule would catch this kind of error: @typescript-eslint/strict-boolean-expressions
Also related, when the library throws an error it includes all fields returned by prisma, possibly including those which are not part of the graphql schema. Meaning that sensitive data can be leaked.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/prisma-adp/nexus-prisma/9vn7sJPto2zvdQeJpHfPPyrH6c9X
✅ Preview: https://nexus-prisma-git-fork-garth-falsy-id-fields-prisma-adp.vercel.app
BTW: adding the following eslint rule would catch this kind of error: @typescript-eslint/strict-boolean-expressions
PR welcome
I intended to create a unit test, but I don't understand how they are structured or even how to setup my system to run them successfully.
Test Suites: 8 failed, 1 skipped, 12 passed, 20 of 21 total
Tests: 15 failed, 1 skipped, 45 passed, 61 total
Snapshots: 5 obsolete, 78 passed, 78 total
@garth I'll try to review the docs and see if there are any missing steps.