Skip to content

GraphQL operations and connections

Adapter design. This page specifies the unpublished adapter. Run a request with Octokit and Effect.

Wrap graphql<T>(query, parameters?) and graphql<T>(options), plus graphql.defaults and its endpoint helper. Plugin augmentation attaches pagination to the instance callable; a new defaulted GraphQL callable may lack that augmentation. Reflect the actual returned callable. Preserve operationName, headers, transport options, GitHub Enterprise URL resolution, and the distinction between reserved option names and variables. Success yields the query data. The caller supplies its result type for arbitrary strings. Typed-document support belongs in a separate extension. Never infer a query schema from its text.

When the pagination plugin exists, expose graphql.paginate<T> for merged data and .iterator as a page Stream. Delegate connection discovery, nodes/edges merging, pageInfo updates, cursor advancement and forward/backward behavior. The plugin expects one paginated resource, a $cursor variable, and the relevant pageInfo fields. Nested or parallel connections need separate operations. Report missing pageInfo or unchanged cursor faithfully; assign no invented status to plugin errors.

Check. Exercise both call forms, variable collision, empty final page, forward and backward cursors, repeated cursor, merged nodes/edges, interruption during page two and HTTP 200 containing both data and errors. Retain GraphQL errors, paths, extensions, headers and partial data. GraphQL client · Pagination source