relay

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

packae relay implements common relay types used in the GraphQL transport layer

packae relay implements common relay types used in the GraphQL transport layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionArgument

type ConnectionArgument struct {
	After  *string
	First  *int32
	Before *string
	Last   *int32
}

type PageInfoResolverContract

type PageInfoResolverContract interface {
	// StartCursor returns start cursor
	// ctx: Mandatory. Reference to the context
	// Returns the start cursor
	StartCursor(ctx context.Context) *string

	// EndCursor returns end cursor
	// ctx: Mandatory. Reference to the context
	// Returns the end cursor
	EndCursor(ctx context.Context) *string

	// HasNextPage indicates whether returned page has next page to be retrieved
	// ctx: Mandatory. Reference to the context
	// Returns the value indicates whether returned page has next page to be retrieved
	HasNextPage(ctx context.Context) bool

	// HasPreviousPage indicates whether returned page has previous page to be retrieved
	// ctx: Mandatory. Reference to the context
	// Returns the value indicates whether returned page has previous page to be retrieved
	HasPreviousPage(ctx context.Context) bool
}

PageInfoResolverContract declares the resolver that returns paging information compatible with graphql-relay specification

type PageInfoResolverCreatorContract

type PageInfoResolverCreatorContract interface {
	// NewPageInfoResolver creates new PageInfoResolverContract and returns it
	// ctx: Mandatory. Reference to the context
	// startCursor: Mandatory. Reference to the start cursor
	// endCursor: Mandatory. Reference to the end cursor
	// hasNextPage: Mandatory. Reference to the value indicates whether returned page has next page to be retrieved
	// hasPreviousPage: Mandatory. Reference to the value indicates whether returned page has previous page to be retrieved
	// Returns the PageInfoResolverContract or error if something goes wrong
	NewPageInfoResolver(
		ctx context.Context,
		startCursor *string,
		endCursor *string,
		hasNextPage bool,
		hasPreviousPage bool) (PageInfoResolverContract, error)
}

Jump to

Keyboard shortcuts

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