graphql

package
v0.0.0-...-610bbfe Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.

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 {
	Device struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	Entity struct {
		FindDeviceByID func(childComplexity int, id string) int
	}

	Query struct {
		Devices func(childComplexity int) int
		// contains filtered or unexported fields
	}

	Service struct {
		SDL func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type Device

type Device struct {
	ID   string  `json:"id"`
	Name *string `json:"name"`
}

func (Device) IsEntity

func (Device) IsEntity()

type DeviceResolver

type DeviceResolver interface {
	Name(ctx context.Context, obj *Device) (*string, error)
}

type DirectiveRoot

type DirectiveRoot struct {
}

type EntityResolver

type EntityResolver interface {
	FindDeviceByID(ctx context.Context, id string) (*Device, error)
}

type QueryResolver

type QueryResolver interface {
	Devices(ctx context.Context) ([]*Device, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Device

func (r *Resolver) Device() DeviceResolver

func (*Resolver) Entity

func (r *Resolver) Entity() EntityResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Device() DeviceResolver
	Entity() EntityResolver
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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