gen

package
v0.0.0-...-60a76ff Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 11 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 {
	Mutation struct {
		ForgotPassword func(childComplexity int, email string) int
		Login          func(childComplexity int, input RegisterLogin) int
		Register       func(childComplexity int, input RegisterLogin) int
		ResetPassword  func(childComplexity int, token string, password string) int
		UpdateUser     func(childComplexity int, input UpdateUser) int
	}

	Query struct {
		User        func(childComplexity int, id int) int
		UserProfile func(childComplexity int) int
	}

	RegisterLoginOutput struct {
		Token func(childComplexity int) int
		User  func(childComplexity int) int
	}

	User struct {
		Active    func(childComplexity int) int
		Email     func(childComplexity int) int
		FirstName func(childComplexity int) int
		ID        func(childComplexity int) int
		LastName  func(childComplexity int) int
		Role      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 {
	Register(ctx context.Context, input RegisterLogin) (*RegisterLoginOutput, error)
	Login(ctx context.Context, input RegisterLogin) (*RegisterLoginOutput, error)
	UpdateUser(ctx context.Context, input UpdateUser) (*User, error)
	ForgotPassword(ctx context.Context, email string) (bool, error)
	ResetPassword(ctx context.Context, token string, password string) (*RegisterLoginOutput, error)
}

type QueryResolver

type QueryResolver interface {
	User(ctx context.Context, id int) (*User, error)
	UserProfile(ctx context.Context) (*User, error)
}

type RegisterLogin

type RegisterLogin struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type RegisterLoginOutput

type RegisterLoginOutput struct {
	Token string `json:"token"`
	User  *User  `json:"user"`
}

type ResolverRoot

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

type UpdateUser

type UpdateUser struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
}

type User

type User struct {
	ID        int    `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Role      string `json:"role"`
	Active    bool   `json:"active"`
}

Jump to

Keyboard shortcuts

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