graph

package
v0.0.0-...-3da160a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

YetAnotherToDoList Copyright © 2023 gilex-dev gilex-dev@proton.me

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

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 {
	Mutation struct {
		CreateTodo func(childComplexity int, input model.NewTodo) int
		CreateUser func(childComplexity int, input model.NewUser) int
		DeleteTodo func(childComplexity int, id string) int
		DeleteUser func(childComplexity int, id string) int
		UpdateTodo func(childComplexity int, id string, changes model.UpdateTodo) int
		UpdateUser func(childComplexity int, id string, changes model.UpdateUser) int
	}

	Query struct {
		Todo  func(childComplexity int, id string) int
		Todos func(childComplexity int) int
		User  func(childComplexity int, id string) int
		Users func(childComplexity int) int
	}

	Todo struct {
		Done func(childComplexity int) int
		ID   func(childComplexity int) int
		Text func(childComplexity int) int
		User func(childComplexity int) int
	}

	User struct {
		FullName func(childComplexity int) int
		ID       func(childComplexity int) int
		Todos    func(childComplexity int) int
		UserName func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateUser(ctx context.Context, input model.NewUser) (*model.User, error)
	CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)
	UpdateTodo(ctx context.Context, id string, changes model.UpdateTodo) (*model.Todo, error)
	UpdateUser(ctx context.Context, id string, changes model.UpdateUser) (*model.User, error)
	DeleteUser(ctx context.Context, id string) (*string, error)
	DeleteTodo(ctx context.Context, id string) (*string, error)
}

type QueryResolver

type QueryResolver interface {
	Todos(ctx context.Context) ([]*model.Todo, error)
	Users(ctx context.Context) ([]*model.User, error)
	User(ctx context.Context, id string) (*model.User, error)
	Todo(ctx context.Context, id string) (*model.Todo, error)
}

type Resolver

type Resolver struct {
}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

func (*Resolver) Todo

func (r *Resolver) Todo() TodoResolver

Todo returns TodoResolver implementation.

func (*Resolver) User

func (r *Resolver) User() UserResolver

User returns UserResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
	Todo() TodoResolver
	User() UserResolver
}

type TodoResolver

type TodoResolver interface {
	User(ctx context.Context, obj *model.Todo) (*model.User, error)
}

type UserResolver

type UserResolver interface {
	Todos(ctx context.Context, obj *model.User) ([]*model.Todo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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