Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: falsy uniqueIdentifierFields causing an exception #198

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

garth
Copy link

@garth garth commented Mar 24, 2022

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.

@vercel
Copy link

vercel bot commented Mar 24, 2022

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

@garth garth changed the title Fix falsy uniqueIdentifierFields causing an exception fix: falsy uniqueIdentifierFields causing an exception Mar 30, 2022
@jasonkuhrt
Copy link
Contributor

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

PR welcome

Copy link
Contributor

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we should have a test for this please 🙏

@garth
Copy link
Author

garth commented Apr 1, 2022

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

@jasonkuhrt
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants