How to make a filter required using nexus-prisma-plugin? #1033
Replies: 1 comment
-
|
Con nexus-prisma-plugin, Se si desidera che t.field('programs', { |
Beta Was this translation helpful? Give feedback.
-
|
Con nexus-prisma-plugin, Se si desidera che t.field('programs', { |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to filter my query results.
My code looks like this:
This query works:
{ programs { name } }But I would like to run a query like this, and I would like the year_id to be required:
{ programs(year_id: 2) { name } }Is there an easy way a achieve this?
I tried
t.crud.programs({ filtering: true }), but this seems not to do anything.UPDATE:
I found out that using
t.crud.programs({ filtering: true })enables filtering like this:{ programs(where:{year_id:{equals:2}}) { name } }One thing left to find out: how can I make "year_id" required.
(I'll update the discussion title to reflect what I want to find out now)
Beta Was this translation helpful? Give feedback.
All reactions