nexus
nexus copied to clipboard
Only pass relational data included in
I have an objectType Customer, which has an ID and one-to-many relationship with Visits, the problem I am having is that I can't limit which visits are shown through the query.
I am using prisma-nexus but since this is just relating to graphql-nexus the code isn't what I use but shows the issue.
t.nullable.field('customer', {
type: "Customer",
args: {
id: nonNull(intArg())
},
resolve: async (_parent, args, context: Context) => {
return { id: args.id, visits: [{ id: 1 }, { id: 2 }] }
},
})
I basically want Nexus to only show the visits that are passed through the query, regardless of the objectType resolver, is this possible? Right now it returns all visits.