question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preview feature feedback: Extended where unique

See original GitHub issue

Please use this issue to share any feedback about the extendedWhereUnique functionality released in v4.5.0.

Documentation can be found here.

If you encounter a bug, please open a bug report in this repo.

Many thanks 👏🏻 from the Prisma team.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
Weakkycommented, Oct 25, 2022

Hey @YaakovR,

Good catch and apologies, this is an oversight from myself. Your use case should work but it’s currently not supported. We’ll add that for the next Prisma release.

To be clear:

  • ✅ 1-1 optional relations should have a WhereInput on nested reads
  • ❌ 1-1 required relations should not have a WhereInput on nested reads.

Adding a WhereInput on required 1-1 relations could break the contract (your datamodel and thus your TS typings) and return null when the types always expect to return something.

2reactions
Weakkycommented, Oct 28, 2022

Hey @jacobchrismarsh,

Batching is currently broken in 4.5.0. However, we have a PR that will land next release which will fix that. Docs will be updated accordingly.

TLDR is: The batching will still work if you only use unique & non-unique scalar fields of the model you’re querying and if the filter applied is equals (or the shortand syntax: field: <value>. So { field: { equals: <value> } } or { field: <value> }).

If you use any boolean operators, relation filters or any other filters than equal on a scalar field, then we will not try to batch findUniques in a findMany and will instead run them independently.

@SamuelMS Are you sure your Prisma CLI is not globally installed and you haven’t forgotten to update it ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the Force Touch trackpad - Apple Support
To see a video of a Force click, choose Apple menu  > System Preferences. Then choose Trackpad, click the Point & Click...
Read more >
Feedback on Preview Features - Microsoft Power BI Community
Solved: Just wondering how to feedback to developers on preview features. I've found a few things over the years that have't quite behaved ......
Read more >
count_distinct() (aggregation function) - Azure Data Explorer
Counts unique values specified by the scalar expression per summary group, or the total number of unique values if the summary group is...
Read more >
The Ultimate Guide to Preview Text - Litmus
Preview text is well supported in all email clients these days (at least the ones based in the United States). With most email...
Read more >
About structured snippet assets - Google Ads Help
Review our policy on structured snippets. ... out more about your products and services: Structured snippets give visitors a preview of the nature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found