common

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDFieldName = "id"

	NodeFieldName     = "node"
	NodeInterfaceName = "Node"

	QueryObjectName        = "Query"
	MutationObjectName     = "Mutation"
	SubscriptionObjectName = "Subscription"

	TypenameFieldName = "__typename"

	InternalServiceName = "%#!"
)

Variables

This section is empty.

Functions

func AsyncMapReduce

func AsyncMapReduce[T, P, A any](
	payload []T,
	acc A,
	mapFunc func(field T) (P, error),
	reduceFunc func(acc A, value P) A,
) (A, gqlerrors.ErrorList)

func IsBuiltinName

func IsBuiltinName(s string) bool

isBuiltInName returns true, if it's a default GQL schema field name, f.e. __typename

func IsEqual

func IsEqual[T comparable](a []T, b []T) bool

func IsMutationObjectName

func IsMutationObjectName(s string) bool

isMutationObjectName returns true if name is Mutation

func IsNodeInterfaceName

func IsNodeInterfaceName(s string) bool

isNodeInterfaceName returns true if name is Node

func IsQueryObjectName

func IsQueryObjectName(s string) bool

isQueryObjectName returns true if name is Query

func IsRootObjectName

func IsRootObjectName(s string) bool

isRootObjectName returns true if name is Query, Mutation or Subscription

func IsSubscriptionObjectName

func IsSubscriptionObjectName(s string) bool

isSubscriptionObjectName returns true if name is Subscription

func SelectionSetToFields

func SelectionSetToFields(selectionSet ast.SelectionSet, parentDef *ast.Definition) []*ast.Field

SelectionSetToFields extracts from selection set all data as fields array parent definition can be null if we don't want to check anything specific if passed don't add fields which're not represented in parent definition

Types

This section is empty.

Jump to

Keyboard shortcuts

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