graphql-nexus / nexus-plugin-prisma

Deprecated
MIT License
829 stars 118 forks source link

make paginationStrategy: "prisma" the default #716

Open macrozone opened 4 years ago

macrozone commented 4 years ago

currently relay style pagination is the default but i assume that most want to have the same semantics on the graphql query as they have on prisma. Also prisma style is strictly superior as it supports offset based pagination AND cursor based (even combination).

I vote for making prisma the default and not relay style. Or make the option at least mandatory so that it needs clear decision.

Keeping relay as the default will result in more support cases and issues in this repo as it does not support every usecase. Keep that in mind.

as we do not have reached version 1.0.0 such a breaking change can be done.

jasonkuhrt commented 4 years ago

Didn't see this before I made my comment here. Rephrasing here:


Before being able to consider this issue we need a way to set pagination strategy at not just t.crud level but Nexus and for all plugins to consume.

The goal is that in Nexus it is easy, the default, to create an API with only one pagination strategy, and that not doing so requires doing something explicit.

Currently Nexus has t.connection which is the closest thing to pagination built in. Its semantically more than just pagination though. What I'm thinking is that we introduce a t.paginated field builder. Then this would react to the global pagination strategy, as would prisma plugin. At that point we can revisit the discussion about what the default should be.