koverto

package
v0.0.0-...-f2e8abd Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package koverto defines the GraphQL API for the Koverto service.

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 Authentication

type Authentication struct {
	Credential *credentials.Credential `json:"credential"`
	User       *users.User             `json:"user"`
}

type ComplexityRoot

type ComplexityRoot struct {
	LoginResponse struct {
		Token func(childComplexity int) int
		User  func(childComplexity int) int
	}

	LogoutResponse struct {
		Ok func(childComplexity int) int
	}

	Mutation struct {
		CreateUser func(childComplexity int, input Authentication) int
		Login      func(childComplexity int, input Authentication) int
		Logout     func(childComplexity int) int
		UpdateUser func(childComplexity int, input users.User) int
	}

	Query struct {
		GetUser func(childComplexity int) int
	}

	User struct {
		CreatedAt func(childComplexity int) int
		Email     func(childComplexity int) int
		Id        func(childComplexity int) int
		Name      func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	Protected func(ctx context.Context, obj interface{}, next graphql.Resolver, authRequired bool) (res interface{}, err error)
}

type LoginResponse

type LoginResponse struct {
	Token string      `json:"token"`
	User  *users.User `json:"user"`
}

type LogoutResponse

type LogoutResponse struct {
	Ok bool `json:"ok"`
}

type MutationResolver

type MutationResolver interface {
	CreateUser(ctx context.Context, input Authentication) (*LoginResponse, error)
	Login(ctx context.Context, input Authentication) (*LoginResponse, error)
	Logout(ctx context.Context) (*LogoutResponse, error)
	UpdateUser(ctx context.Context, input users.User) (*users.User, error)
}

type QueryResolver

type QueryResolver interface {
	GetUser(ctx context.Context) (*users.User, error)
}

type ResolverRoot

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

Jump to

Keyboard shortcuts

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