We currently support a page[offset] parameter. This updates the codebase to accept before and after cursors, applying the relevant offset logic as appropriate.
When JSON:API we're render meta: { cursor: <cursor> } for each entity, and when flat JSON/GraphQL we'll render _cursor: <cursor>. This is to support GQL queries like
employees {
nodes {
firstName
_cursor
}
}
We're not doing a full edges implementation because A) I just kinda hate it and B) to value here is metadata about the relationship, mostly for M2M relationships, which Graphiti doesn't support yet anyway.
The cursor is Base64 encoded JSON of {offset: <offset>}.
In addition, we accept ?fields[page_info]=has_next_page,etc to render the relevant pageInfo section. This uses the same code already used to populate pagination links and cursors.
We currently support a
page[offset]
parameter. This updates the codebase to acceptbefore
andafter
cursors, applying the relevantoffset
logic as appropriate.When JSON:API we're render
meta: { cursor: <cursor> }
for each entity, and when flat JSON/GraphQL we'll render_cursor: <cursor>
. This is to support GQL queries likeWe're not doing a full
edges
implementation because A) I just kinda hate it and B) to value here is metadata about the relationship, mostly for M2M relationships, which Graphiti doesn't support yet anyway.The cursor is Base64 encoded JSON of
{offset: <offset>}
.In addition, we accept
?fields[page_info]=has_next_page,etc
to render the relevantpageInfo
section. This uses the same code already used to populate pagination links and cursors.