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: make nots optional #255

Merged

Conversation

kenny-stevens
Copy link
Contributor

Upon using this generator I've ran into an issue where the not condition was mandatory for some of the typed filters.

I think this was a mistake, so I've pushed a PR where this is no longer the case, alongside some tests.

Before this fix when making a WHERE IN, we'd be forced to make a WHERE NOT as well by ts.

Example before fix:

    prismaClient.someModel.findFirst({
      where: {
        someColumn: {
          in: [ ...listOfValues ],
          not: 'I have to include a not condition too otherwise ts complains :( how sad'
        },
      },
    });

Now

    prismaClient.someModel.findFirst({
      where: {
        someColumn: {
          in: [ ...listOfValues ],
        },
      },
    });

@arthurfiorette
Copy link
Owner

Thanks!

@arthurfiorette arthurfiorette merged commit 48a7506 into arthurfiorette:main Feb 17, 2024
2 checks passed
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