tests

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "v1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type AllResultsQuery

type AllResultsQuery struct {
	Errors []Error               `json:"errors"`
	Data   []AllResultsQueryData `graphql:"query"`
}

AllResultsQuery is used for both specifying the query and capturing the response.

func (AllResultsQuery) Build

func (_q AllResultsQuery) Build(
	operationName string,
	_before CustomDate,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type AllResultsQueryData

type AllResultsQueryData struct {
	Result `graphql:"allResults(before: $before)" json:"allResults"`
}

type Boolean

type Boolean bool

type CreateResultMutation

type CreateResultMutation struct {
	Errors []Error `json:"errors"`
	Data   struct {
		ID `graphql:"createResult(input: $input)" json:"createResult"`
	} `graphql:"mutation"`
}

CreateResultMutation calls createResult(input:ResultInput!):ID! create a Result

func (CreateResultMutation) Build

func (_m CreateResultMutation) Build(
	_input ResultInput,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type CustomDate

type CustomDate string

type Error added in v0.4.2

type Error struct {
	Message   string `json:"message,omitempty"`
	Locations []struct {
		Line   int `json:"line"`
		Column int `json:"column"`
	} `json:"locations,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

Error is a response field element to capture server reported problems

type FilterOpMutation

type FilterOpMutation struct {
	Errors []Error `json:"errors"`
	Data   []struct {
		Result `graphql:"filterOp(sort: $sort)" json:"filterOp"`
	} `graphql:"mutation"`
}

FilterOpMutation calls filterOp(sort:String!):Result

func (FilterOpMutation) Build

func (_m FilterOpMutation) Build(
	_sort string,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type FilterOpQuery

type FilterOpQuery struct {
	Errors []Error             `json:"errors"`
	Data   []FilterOpQueryData `graphql:"query"`
}

FilterOpQuery is used for both specifying the query and capturing the response.

func (FilterOpQuery) Build

func (_q FilterOpQuery) Build(
	operationName string,
	_sort string,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type FilterOpQueryData

type FilterOpQueryData struct {
	Result `graphql:"filterOp(sort: $sort)" json:"filterOp"`
}

type Float

type Float float64

type GraphQLRequest

type GraphQLRequest struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

GraphQLRequest is used to model both a query or a mutation request

func NewGraphQLRequest

func NewGraphQLRequest(query, operation string, vars ...map[string]interface{}) GraphQLRequest

NewGraphQLRequest returns a new Request (for query or mutation) with optional or empty variables.

type ID

type ID interface{}

ID can by any type, typically a string or int64

type Identified

type Identified struct {
	ID interface{} `graphql:"id" json:"id,omitempty"`
}

Identified is a INTERFACE.

type Int

type Int int32

type ListOpMutation

type ListOpMutation struct {
	Errors []Error `json:"errors"`
	Data   []struct {
		Result `graphql:"ListOp(limit: $limit,prefix: $prefix)" json:"ListOp"`
	} `graphql:"mutation"`
}

ListOpMutation calls ListOp(limit:Int,prefix:String!):Result

func (ListOpMutation) Build

func (_m ListOpMutation) Build(
	_limit int32,
	_prefix string,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type ListOpQuery

type ListOpQuery struct {
	Errors []Error           `json:"errors"`
	Data   []ListOpQueryData `graphql:"query"`
}

ListOpQuery is used for both specifying the query and capturing the response.

func (ListOpQuery) Build

func (_q ListOpQuery) Build(
	operationName string,
	_limit int32,
	_prefix string,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type ListOpQueryData

type ListOpQueryData struct {
	Result `graphql:"ListOp(limit: $limit,prefix: $prefix)" json:"ListOp"`
}

type NoArgOpMutation

type NoArgOpMutation struct {
	Errors []Error `json:"errors"`
	Data   struct {
		Int `graphql:"noArgOp()" json:"noArgOp"`
	} `graphql:"mutation"`
}

NoArgOpMutation calls noArgOp():Int!

func (NoArgOpMutation) Build

func (_m NoArgOpMutation) Build() GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type NoArgOpQuery

type NoArgOpQuery struct {
	Errors []Error          `json:"errors"`
	Data   NoArgOpQueryData `graphql:"query"`
}

NoArgOpQuery is used for both specifying the query and capturing the response.

func (NoArgOpQuery) Build

func (_q NoArgOpQuery) Build(
	operationName string,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type NoArgOpQueryData

type NoArgOpQueryData struct {
	// contains filtered or unexported fields
}

type OneArgOpMutation

type OneArgOpMutation struct {
	Errors []Error `json:"errors"`
	Data   struct {
		String `graphql:"oneArgOp(required: $required)" json:"oneArgOp"`
	} `graphql:"mutation"`
}

OneArgOpMutation calls oneArgOp(required:Boolean!):String

func (OneArgOpMutation) Build

func (_m OneArgOpMutation) Build(
	_required bool,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type OneArgOpQuery

type OneArgOpQuery struct {
	Errors []Error           `json:"errors"`
	Data   OneArgOpQueryData `graphql:"query"`
}

OneArgOpQuery is used for both specifying the query and capturing the response.

func (OneArgOpQuery) Build

func (_q OneArgOpQuery) Build(
	operationName string,
	_required bool,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type OneArgOpQueryData

type OneArgOpQueryData struct {
	// contains filtered or unexported fields
}

type PlusArrayOpMutation

type PlusArrayOpMutation struct {
	Errors []Error `json:"errors"`
	Data   []struct {
		Int `graphql:"plusArrayOp(as: $as,bs: $bs)" json:"plusArrayOp"`
	} `graphql:"mutation"`
}

PlusArrayOpMutation calls plusArrayOp(as:Int!,bs:[Int!]):Int

func (PlusArrayOpMutation) Build

func (_m PlusArrayOpMutation) Build(
	_as []int32,
	_bs []int32,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type PlusArrayOpQuery

type PlusArrayOpQuery struct {
	Errors []Error                `json:"errors"`
	Data   []PlusArrayOpQueryData `graphql:"query"`
}

PlusArrayOpQuery is used for both specifying the query and capturing the response.

func (PlusArrayOpQuery) Build

func (_q PlusArrayOpQuery) Build(
	operationName string,
	_as []int32,
	_bs []int32,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type PlusArrayOpQueryData

type PlusArrayOpQueryData struct {
	// contains filtered or unexported fields
}

type PlusOpMutation

type PlusOpMutation struct {
	Errors []Error `json:"errors"`
	Data   struct {
		Int `graphql:"plusOp(a: $a,b: $b)" json:"plusOp"`
	} `graphql:"mutation"`
}

PlusOpMutation calls plusOp(a:Int!,b:Int!):Int

func (PlusOpMutation) Build

func (_m PlusOpMutation) Build(
	_a int32,
	_b int32,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type PlusOpQuery

type PlusOpQuery struct {
	Errors []Error         `json:"errors"`
	Data   PlusOpQueryData `graphql:"query"`
}

PlusOpQuery is used for both specifying the query and capturing the response.

func (PlusOpQuery) Build

func (_q PlusOpQuery) Build(
	operationName string,
	_a int32,
	_b int32,
) GraphQLRequest

Build returns a GraphQLRequest with all the parts to send the HTTP request.

type PlusOpQueryData

type PlusOpQueryData struct {
	// contains filtered or unexported fields
}

type Result

type Result struct {
	// will map to CustomDate
	When        *CustomDate             `graphql:"when" json:"when,omitempty"`
	Explanation *ResultExplanationField `graphql:"explanation" json:"explanation,omitempty"`
	ID          interface{}             `graphql:"id" json:"id,omitempty"`
	// GraphQLTypename is a metadata field
	GraphQLTypename string `graphql:"__typename" json:"__typename,omitempty"`
}

Result is a OBJECT.

type ResultExplanationField added in v0.5.0

type ResultExplanationField struct {
	Language string `graphql-function-arg:"language" graphql-function-type:"String!"`
	Long     *bool  `graphql-function-arg:"long" graphql-function-type:"Boolean"`
	// Result captures the query response part of this function.
	Result string `graphql:"inline"`
}

explanation(language:String!,long:Boolean):String!

func (*ResultExplanationField) UnmarshalJSON added in v0.5.0

func (f *ResultExplanationField) UnmarshalJSON(data []byte) error

type ResultInput

type ResultInput map[string]interface{}

ResultInput is an INPUT_OBJECT. comment for ResultInput when:Date! unused:String @deprecated

func (ResultInput) MarshalJSON added in v0.3.0

func (i ResultInput) MarshalJSON() ([]byte, error)

func (ResultInput) Unused

func (i ResultInput) Unused(v *string) ResultInput

comment for unused unused:String @deprecated

func (ResultInput) When

comment for when when:Date!

type String

type String string

These aliases are needed to model return types in Data fields

type URL

type URL string

URL is a Scalar.

func NewURL

func NewURL(s string) *URL

NewURL returns a pointer to a URL value. Use type conversion instead e.g. v := URL(s) if you need the non-pointer value.

Jump to

Keyboard shortcuts

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