Skip to content

docs: add pagination reference — offset vs cursor, nested relations#70

Merged
pyramation merged 2 commits intomainfrom
devin/1774128483-pagination-skill
Mar 22, 2026
Merged

docs: add pagination reference — offset vs cursor, nested relations#70
pyramation merged 2 commits intomainfrom
devin/1774128483-pagination-skill

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Mar 21, 2026

Summary

Adds a dedicated pagination.md reference to the constructive-graphql skill. Previously, pagination knowledge was scattered across 5+ files with no single source of truth. This consolidates everything into one reference covering:

  • The Connection model — PostGraphile's Relay-based connection type (nodes, pageInfo, totalCount)
  • Offset vs cursor pagination — when to use each, with examples across all three query surfaces (ORM, React Query hooks, runtime query builder)
  • Forward and backward pagingfirst/after and last/before
  • Nested relation pagination — independent pagination on hasMany/manyToMany connections
  • TypeScript typesConnectionResult<T>, PageInfo, FindManyArgs
  • Decision matrix — offset vs cursor
  • Codebase reference table — maps pagination behavior to source files

Also updates SKILL.md:

  • Quick Start pagination section now links to pagination.md instead of codegen-orm-patterns.md
  • Reference table splits pagination into its own row

Updates since last revision

  • Removed all edges content — Constructive uses nodes exclusively, so the edges discussion and decision guide were removed to avoid confusion
  • Rewrote the infinite scroll React Query example to use the ORM (db.user.findMany().execute().unwrap()) instead of raw GraphQL strings
  • Simplified the Connection model GraphQL example to only show nodes-based types
  • Cleaned up codebase reference table to remove edge-related entries

Review & Testing Checklist for Human

  • Verify the ORM code examples match actual API signatures — especially findMany args (first, last, after, before, offset), ConnectionResult shape, and .execute().unwrap() chain
  • Check the infinite scroll example — confirm that db.user.findMany().execute().unwrap() returns a shape where lastPage.pageInfo.hasNextPage and lastPage.pageInfo.endCursor are directly accessible (used by getNextPageParam)
  • Skim the codebase reference table at the bottom — line numbers will drift but verify the file paths and behavioral descriptions are currently accurate

Notes

  • Documentation-only change, no runtime risk
  • All examples use the ORM exclusively — no raw GraphQL strings

Link to Devin session: https://app.devin.ai/sessions/745d2d10b699452091e24131ba5edef2
Requested by: @pyramation

@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot changed the title docs: add pagination reference — offset vs cursor, nodes vs edges, nested relations docs: add pagination reference — offset vs cursor, nested relations Mar 22, 2026
@pyramation pyramation merged commit e7b01a5 into main Mar 22, 2026
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

Successfully merging this pull request may close these issues.

1 participant