Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prisma crud pagination options more flexible #1128

Open
soosap opened this issue Feb 17, 2022 · 0 comments
Open

Make prisma crud pagination options more flexible #1128

soosap opened this issue Feb 17, 2022 · 0 comments

Comments

@soosap
Copy link

soosap commented Feb 17, 2022

I actually prefer the prisma type pagination pattern. However, I now came across a special use case where I need a relay style pagination pattern. Would be nice, if I not only could set my default pagination preference in the makeSchema constructor, but also be able to override the pagination strategy on a case by case basis. What do you think?

Status Quo:

import { extendType } from 'nexus'

export const crudOperations = extendType({
  type: 'Query',
  definition(t) {
    t.crud.recording()
    t.crud.recordings({ pagination: true, filtering: true })
  },
})

Desired:

import { extendType } from 'nexus'

export const crudOperations = extendType({
  type: 'Query',
  definition(t) {
    t.crud.recording()
    t.crud.recordings({ pagination: { strategy: 'relay' }, filtering: true })
  },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant