graph

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 19 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 {
	CategoryCount struct {
		Category func(childComplexity int) int
		Count    func(childComplexity int) int
	}

	Event struct {
		Content   func(childComplexity int) int
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Research  func(childComplexity int) int
		User      func(childComplexity int) int
		UserAgent func(childComplexity int) int
	}

	EventConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	EventEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	GroupCountResult struct {
		Results func(childComplexity int) int
		Total   func(childComplexity int) int
	}

	Mutation struct {
		CreateEvent          func(childComplexity int, input model.CreateEventInput) int
		CreateUser           func(childComplexity int, input model.CreateUserInput) int
		Login                func(childComplexity int, input model.LoginInput) int
		RequestPasswordReset func(childComplexity int, input model.RequestPasswordResetInput) int
		ResetPassword        func(childComplexity int, input model.ResetPasswordInput) int
	}

	PageInfo struct {
		EndCursor       func(childComplexity int) int
		HasNextPage     func(childComplexity int) int
		HasPreviousPage func(childComplexity int) int
		StartCursor     func(childComplexity int) int
	}

	Query struct {
		Event      func(childComplexity int, id string) int
		Events     func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.EventOrder) int
		GroupCount func(childComplexity int, input model.GroupCountInput) int
		Me         func(childComplexity int) int
		Node       func(childComplexity int, id string) int
		Nodes      func(childComplexity int, ids []string) int
		Research   func(childComplexity int, id string) int
		Researches func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.ResearchOrder) int
	}

	Research struct {
		ID     func(childComplexity int) int
		Name   func(childComplexity int) int
		Schema func(childComplexity int) int
	}

	ResearchConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	ResearchEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	User struct {
		Attributes func(childComplexity int) int
		Email      func(childComplexity int) int
		ID         func(childComplexity int) int
		Name       func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	Admin   func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	Private func(ctx context.Context, obj interface{}, next graphql.Resolver, userIDFieldName *string) (res interface{}, err error)
}

type MutationResolver

type MutationResolver interface {
	Login(ctx context.Context, input model.LoginInput) (*ent.User, error)
	CreateEvent(ctx context.Context, input model.CreateEventInput) (*ent.Event, error)
	RequestPasswordReset(ctx context.Context, input model.RequestPasswordResetInput) (bool, error)
	ResetPassword(ctx context.Context, input model.ResetPasswordInput) (bool, error)
	CreateUser(ctx context.Context, input model.CreateUserInput) (*ent.User, error)
}

type QueryResolver

type QueryResolver interface {
	Me(ctx context.Context) (*ent.User, error)
	Node(ctx context.Context, id string) (ent.Noder, error)
	Nodes(ctx context.Context, ids []string) ([]ent.Noder, error)
	GroupCount(ctx context.Context, input model.GroupCountInput) (*model.GroupCountResult, error)
	Event(ctx context.Context, id string) (*ent.Event, error)
	Events(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.EventOrder) (*ent.EventConnection, error)
	Research(ctx context.Context, id string) (*ent.Research, error)
	Researches(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.ResearchOrder) (*ent.ResearchConnection, error)
}

type ResearchResolver

type ResearchResolver interface {
	Schema(ctx context.Context, obj *ent.Research) (interface{}, error)
}

type Resolver

type Resolver struct {
	ResolverDeps
}

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) Research

func (r *Resolver) Research() ResearchResolver

Research returns ResearchResolver implementation.

type ResolverDeps

type ResolverDeps struct {
	fx.In

	Ent          *ent.Client
	AuthService  service.Auth
	EventService service.Event
}

type ResolverRoot

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

Jump to

Keyboard shortcuts

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