Skip to main content

@baeta/plugin-pagination

Interfaces

PaginationOptions

Configuration options for the pagination plugin

Properties

PropertyTypeDefault valueDescription

types

Record<string, boolean | PaginationTypeOptions>

undefined

Map of type names to their pagination configuration.

Example

{
// Simple configuration
User: true,

// Advanced configuration
UserCustom: {
nodeType: "User",
cursorType: "UUID!",
connectionFields: ["totalCount: Int!"],
edgeFields: ["hasPhotos: Boolean!"]
}
}

createExport?

boolean

undefined

Whether to create an export file

moduleName?

string

"baeta-pagination";

Custom name for the pagination module

nullableNode?

boolean

true;

Whether the node field should be nullable in all connections

pageInfoFields?

string[]

undefined

Additional fields to add to the PageInfo type

Example

["hasMorePages: Boolean!"];

PaginationTypeOptions

Configuration options for a specific pagination type

Properties

PropertyTypeDefault valueDescription

connectionFields?

string[]

undefined

Additional fields to add to the connection type

Example

connectionFields: ["totalCount: Int!"];

cursorType?

string

"ID!";

The GraphQL type for cursors

edgeFields?

string[]

undefined

Additional fields to add to the edge type

Example

edgeFields: ["hasPhotos: Boolean!"];

nodeType?

string

undefined

The GraphQL type for nodes (e.g., "User!")

Functions

paginationPlugin()

paginationPlugin(options): GeneratorPluginV1<unknown>

A plugin that generates Relay-style pagination types for GraphQL. See https://baeta.io/docs/plugins/pagination for more details

Parameters

ParameterTypeDescription

options

PaginationOptions

Configuration options for the pagination plugin

Returns

GeneratorPluginV1<unknown>

A Baeta generator plugin