nexus-prisma icon indicating copy to clipboard operation
nexus-prisma copied to clipboard

fix: falsy uniqueIdentifierFields causing an exception

Open garth opened this issue 2 years ago • 4 comments

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.

garth avatar Mar 24 '22 19:03 garth

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

vercel[bot] avatar Mar 24 '22 19:03 vercel[bot]

BTW: adding the following eslint rule would catch this kind of error: @typescript-eslint/strict-boolean-expressions

PR welcome

jasonkuhrt avatar Apr 01 '22 17:04 jasonkuhrt

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 avatar Apr 01 '22 17:04 garth

@garth I'll try to review the docs and see if there are any missing steps.

jasonkuhrt avatar Apr 01 '22 23:04 jasonkuhrt