Documentation
¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EntityRepresentation
- type EntityResolver
- type EntityWithIndex
- type KeyValue
- type KeyValueInput
- type Language
- type Mutation
- type MutationResolver
- type NewResourceInput
- type Project
- type Query
- type QueryResolver
- type ResolverRoot
- type Resource
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownType = errors.New("unknown type") ErrTypeNotFound = errors.New("type not found") )
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 {
FindLanguageByID func(childComplexity int, id string) int
FindProjectByID func(childComplexity int, id string) int
FindResourceByID func(childComplexity int, id string) int
}
KeyValue struct {
Key func(childComplexity int) int
Value func(childComplexity int) int
}
Language struct {
ID func(childComplexity int) int
Name func(childComplexity int) int
}
Mutation struct {
DeleteResource func(childComplexity int, projectID string, languageID string, semver string) int
NewLanguage func(childComplexity int, id string, name string) int
NewProject func(childComplexity int, id string, name string) int
NewResource func(childComplexity int, request NewResourceInput) int
}
Project struct {
ID func(childComplexity int) int
Name func(childComplexity int) int
}
Query struct {
GetLanguage func(childComplexity int, id string) int
GetProject func(childComplexity int, id string) int
GetResource func(childComplexity int, projectID string, languageID string, semver string) int
GetVersions func(childComplexity int, projectID string, languageID string) int
// contains filtered or unexported fields
}
Resource struct {
ID func(childComplexity int) int
LanguageID func(childComplexity int) int
ProjectID func(childComplexity int) int
Semver func(childComplexity int) int
Values func(childComplexity int) int
}
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Schema *ast.Schema
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type EntityRepresentation ¶
EntityRepresentation is the JSON representation of an entity sent by the Router used as the inputs for us to resolve.
We make it a map because we know the top level JSON is always an object.
type EntityResolver ¶
type EntityWithIndex ¶
type EntityWithIndex struct {
// contains filtered or unexported fields
}
type KeyValueInput ¶
type MutationResolver ¶
type MutationResolver interface {
NewProject(ctx context.Context, id string, name string) (string, error)
NewLanguage(ctx context.Context, id string, name string) (string, error)
NewResource(ctx context.Context, request NewResourceInput) (string, error)
DeleteResource(ctx context.Context, projectID string, languageID string, semver string) (string, error)
}
type NewResourceInput ¶
type NewResourceInput struct {
ProjectID string `json:"projectId"`
LanguageID string `json:"languageId"`
Semver string `json:"semver"`
Values []*KeyValueInput `json:"values"`
}
type QueryResolver ¶
type QueryResolver interface {
GetProject(ctx context.Context, id string) (*Project, error)
GetLanguage(ctx context.Context, id string) (*Language, error)
GetResource(ctx context.Context, projectID string, languageID string, semver string) (*Resource, error)
GetVersions(ctx context.Context, projectID string, languageID string) ([]string, error)
}
type ResolverRoot ¶
type ResolverRoot interface {
Entity() EntityResolver
Mutation() MutationResolver
Query() QueryResolver
}
Click to show internal directories.
Click to hide internal directories.