GraphQL: Paginate Entries field response #8686
-
Hi everyone, does anyone know, how/if i could paginate an entries field inside a graphql response? As a simplified example:
So, i would like to just return 10 related_data entries instead of an (possibly) ever growing amount X. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
What does your GraphQL query look like? |
Beta Was this translation helpful? Give feedback.
-
Those nested entries fields cannot be paginated. Typically, those fields don't have enough items selected to warrant pagination. If you really want it, you could use a custom public function toGqlType()
{
return GraphQL::paginate(GraphQL::type('EntryInterface'));
} |
Beta Was this translation helpful? Give feedback.
Those nested entries fields cannot be paginated. Typically, those fields don't have enough items selected to warrant pagination.
If you really want it, you could use a custom
entries
fieldtype that extends the native one, and just override thetoGqlType
method.