paging

package
v0.0.0-...-ef759c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cursor = graphql.NewScalar(graphql.ScalarConfig{
	Name: "Cursor",
	Serialize: func(value interface{}) interface{} {
		return value
	},
})
View Source
var PageCursor = graphql.NewObject(graphql.ObjectConfig{
	Name: "PageCursor",
	Fields: graphql.Fields{
		"cursor": &graphql.Field{
			Type: Cursor,
		},
		"pageNumber": &graphql.Field{
			Type: graphql.NewNonNull(graphql.Int),
		},
	},
})
View Source
var PageCursors = graphql.NewObject(graphql.ObjectConfig{
	Name: "PageCursors",
	Fields: graphql.Fields{
		"first": &graphql.Field{
			Type: PageCursor,
		},
		"around": &graphql.Field{
			Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(PageCursor))),
		},
		"last": &graphql.Field{
			Type: PageCursor,
		},
	},
})
View Source
var PageInfo = graphql.NewObject(graphql.ObjectConfig{
	Description: "https://relay.dev/graphql/connections.htm#sec-Connection-Types.Fields.PageInfo",
	Name:        "PageInfo",
	Fields: graphql.Fields{
		"hasNextPage": &graphql.Field{
			Type: graphql.NewNonNull(graphql.Boolean),
		},
		"hasPreviousPage": &graphql.Field{
			Type: graphql.NewNonNull(graphql.Boolean),
		},
		"startCursor": &graphql.Field{
			Type: Cursor,
		},
		"endCursor": &graphql.Field{
			Type: Cursor,
		},
	},
})

Functions

func NewConnection

func NewConnection(gqltype graphql.Type) *graphql.Object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL