Open P4sca1 opened 4 years ago
A more flexible solution would be to allow the pagination
option to be an object. So you could do
pagination: {
required: true
}
See https://github.com/graphql-nexus/nexus-plugin-prisma/issues/841#issuecomment-711436792
An option to enforce pagination parameters like
take
(prisma strategy) orfirst
/last
(relay strategy) on a per field basis would be great.pagination: true
would enable optional pagination (as it is now) andpagination: 'required'
would mark the fields in the graphql schema as required and also validate that the args are set at runtime. This would be helpful in scenarios where a query cost analyzer is used, which requires those arguments to calculate the correct cost of the query.Workaround for the prisma strategy:
The workaround has the disadvantage that the graphql schema marks the
take
argument as optional, but it is required.