graphql

package
v0.387.1-next.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuiltInScalars = []string{
		"Int",
		"Float",
		"String",
		"Boolean",
		"ID",
	}
)

Functions

func ActionFunc

func ActionFunc(schema *proto.Schema, action *proto.Action) func(p graphql.ResolveParams) (interface{}, error)

func NewGraphQLSchema

func NewGraphQLSchema(proto *proto.Schema, api *proto.Api) (*graphql.Schema, error)

NewGraphQLSchema creates a map of graphql.Schema objects where the keys are the API names from the provided proto.Schema

func NewHandler

func NewHandler(s *proto.Schema, api *proto.Api) common.HandlerFunc

func ToGraphQLSchemaLanguage

func ToGraphQLSchemaLanguage(response common.Response) string

ToGraphQLSchemaLanguage converts the result of an introspection query into a GraphQL schema string Note: this implementation is not complete and only covers cases that are relevant to us, for example directives are not handled

Types

type GraphQLRequest

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

type IntrospectionQueryResult

type IntrospectionQueryResult struct {
	Schema struct {
		MutationType struct {
			Name string `json:"name"`
		} `json:"mutationType"`
		QueryType struct {
			Name string `json:"name"`
		} `json:"queryType"`
		Types []struct {
			EnumValues []struct {
				Name string
			} `json:"enumValues"`
			Fields        []introspectionField `json:"fields"`
			InputFields   []introspectionField `json:"inputFields"`
			Interfaces    interface{}          `json:"interfaces"`
			Kind          string               `json:"kind"`
			Name          string               `json:"name"`
			PossibleTypes interface{}          `json:"possibleTypes"`
		} `json:"types"`
	} `json:"__schema"`
}

Represents the result of executing github.com/teamkeel/graphql/testutil.IntrospectionQuery

type Request

type Request struct {
	Context context.Context
	Path    string
	Body    []byte
}

type Response

type Response struct {
	Body   []byte
	Status int
}

Jump to

Keyboard shortcuts

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