graphql

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 12 Imported by: 0

README

GraphQL

直接运行

go run github.com/99designs/gqlgen

二进制

安装
go install github.com/99designs/gqlgen@latest
运行
gqlgen

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Hygrothermograph struct {
		Humidity    func(childComplexity int) int
		Temperature func(childComplexity int) int
	}

	Query struct {
		Hygrothermograph func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Hygrothermograph

type Hygrothermograph struct {
	Humidity    float64 `json:"humidity"`
	Temperature float64 `json:"temperature"`
}

type QueryResolver

type QueryResolver interface {
	Hygrothermograph(ctx context.Context) (*Hygrothermograph, error)
}

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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