utils

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurationFunc added in v1.6.1

func ConfigurationFunc[InputType, OutputType, ResponseType any](config Configuration[InputType, OutputType, ResponseType], graphql graphql.GraphQL) func(InputType) (*OutputType, error)

func Test added in v1.6.5

func Test[Input, ExpectedData, MockResponse, Service any](t *testing.T, config TestConfig[Input, ExpectedData, MockResponse, Service])

Types

type Account

type Account[T any] struct {
	ById T `json:"byId"`
}

type AccountResponse

type AccountResponse[T any] struct {
	Account Account[T] `json:"account"`
}

type Configuration added in v1.6.1

type Configuration[InputType any, OutputType any, ResponseType any] struct {
	Query        string
	InputMapper  func(InputType) map[string]any
	OutputMapper func(ResponseType, InputType) *OutputType
}

type TestConfig added in v1.6.5

type TestConfig[Input, ExpectedData, MockResponse, Service any] struct {
	Input              *Input
	ExpectedQuery      string
	ExpectedVariables  map[string]any
	ExpectedData       *ExpectedData
	MockResponse       MockResponse
	NewServiceFunction func(graphql.GraphQL) Service
	FunctionUnderTest  string
}

Jump to

Keyboard shortcuts

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