Filter conditions help needed
See original GitHub issueI’m using prisma2 for some weeks now, but i’m often stuck because of lack of documentation on some specifics points. I’m trying to do a simple query like WHERE value > 1
I can’t find any examples.
In prisma1 it’s something with <fieldnams>_gt
for greater than as explained here :
https://github.com/prisma/prisma/issues/1890
That should look like this :
t.list.field('blocks_others', {
type: 'Block',
args: {
owner_address_exclude: stringArg({ nullable: true }),
value: intArg({ nullable: true }),
},
resolve: (parent, { owner_address_exclude, value }, context) => {
return context.prisma.block.findMany({
where: {
NOT : {
owner_address : owner_address_exclude
},
resale_price_gt : value
},
orderBy: { id: 'asc' },
})
},
})
And I get :
Unknown arg `resale_price_gt` in where.resale_price_gt for type BlockWhereInput. Did you mean resale_price`? Available args: ...
Thanks for helping Best
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Filter by using advanced criteria - Microsoft Support
If the data you want to filter requires complex criteria (such as Type = "Produce" OR Salesperson = "Davolio"), you can use the...
Read more >Excel FILTER function with formula examples - Ablebits
See how to filter in Excel dynamically with formulas. Examples to filter duplicates, cells containing certain text, with multiple criteria, ...
Read more >Advanced Filter Examples in Google Sheets - Ben Collins
How to use an advanced filter with an OR condition in Google Sheets, so you can filter multiple conditions quickly and easily.
Read more >Adding Conditions to Filters - FICO Help
Adding Conditions to Filters · Click the Add additional filter conditions link and select the condition type. · (Optional) Click the Add icon...
Read more >Using the AND, OR, and NOT functions - Google Ads Editor Help
The AND(...) OR(...) and NOT(...) functions allow greater control in how multiple filter conditions are combined to target very specific items being ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Documentation now available: https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/filtering 📚
This is expected.
token
is not a unique property, there is always a chance the the when you query bytoken
it will return more than one record.So will need to use
findMany
herefindOne
is meant to query one record identified by a unique identifier. Or you can make thetoken
property unique but that doesn’t make much sense in this case.