graphql

package
v0.0.0-...-4f36034 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

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 {
	Entity struct {
		FindProblemReportByID         func(childComplexity int, id string) int
		FindProblemReportCategoryByID func(childComplexity int, id string) int
	}

	Mutation struct {
		Create func(childComplexity int, input ProblemReportCreateResource) int
	}

	ProblemReport struct {
		ID   func(childComplexity int) int
		Pos  func(childComplexity int) int
		Type func(childComplexity int) int
	}

	ProblemReportCategory struct {
		ID         func(childComplexity int) int
		Label      func(childComplexity int) int
		ReportType func(childComplexity int) int
	}

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

	WGS84Position struct {
		Lat func(childComplexity int) int
		Lon func(childComplexity int) int
	}
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Entity

type Entity struct {
	FindProblemReportByID         *ProblemReport         `json:"findProblemReportByID"`
	FindProblemReportCategoryByID *ProblemReportCategory `json:"findProblemReportCategoryByID"`
}

type EntityResolver

type EntityResolver interface {
	FindProblemReportByID(ctx context.Context, id string) (*ProblemReport, error)
	FindProblemReportCategoryByID(ctx context.Context, id string) (*ProblemReportCategory, error)
}

type MutationResolver

type MutationResolver interface {
	Create(ctx context.Context, input ProblemReportCreateResource) (*ProblemReport, error)
}

type ProblemReport

type ProblemReport struct {
	ID   string         `json:"id"`
	Pos  *WGS84Position `json:"pos"`
	Type string         `json:"type"`
}

func (ProblemReport) Is_Entity

func (ProblemReport) Is_Entity()

type ProblemReportCategory

type ProblemReportCategory struct {
	ID         string `json:"id"`
	Label      string `json:"label"`
	ReportType string `json:"reportType"`
}

func (ProblemReportCategory) Is_Entity

func (ProblemReportCategory) Is_Entity()

type ProblemReportCreateResource

type ProblemReportCreateResource struct {
	Pos  *ReportPosition `json:"pos"`
	Type string          `json:"type"`
}

type QueryResolver

type QueryResolver interface {
	GetAll(ctx context.Context) ([]*ProblemReport, error)
	GetCategories(ctx context.Context) ([]*ProblemReportCategory, error)
}

type ReportPosition

type ReportPosition struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

type Resolver

type Resolver struct{}

func (*Resolver) Entity

func (r *Resolver) Entity() EntityResolver

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Entity() EntityResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

type WGS84Position

type WGS84Position struct {
	Lon float64 `json:"lon"`
	Lat float64 `json:"lat"`
}

Jump to

Keyboard shortcuts

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