graph

package
v0.0.0-...-1969f72 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 16 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 {
	AuthData struct {
		Token func(childComplexity int) int
	}

	Message struct {
		Content func(childComplexity int) int
		ID      func(childComplexity int) int
		User    func(childComplexity int) int
	}

	Mutation struct {
		CreateUser    func(childComplexity int, userInput model.UserInput) int
		PostMessage   func(childComplexity int, user string, content string) int
		ResetPassword func(childComplexity int, email string) int
	}

	Query struct {
		Login    func(childComplexity int, email string, password string) int
		Me       func(childComplexity int) int
		Messages func(childComplexity int) int
	}

	Subscription struct {
		Messages func(childComplexity int) int
	}

	User struct {
		Birthday             func(childComplexity int) int
		CountryCode          func(childComplexity int) int
		CreatedAt            func(childComplexity int) int
		DeletedAt            func(childComplexity int) int
		Email                func(childComplexity int) int
		FullName             func(childComplexity int) int
		Gender               func(childComplexity int) int
		Height               func(childComplexity int) int
		ID                   func(childComplexity int) int
		IdentificationNumber func(childComplexity int) int
		IdentificationType   func(childComplexity int) int
		Ocupation            func(childComplexity int) int
		PhoneNumber          func(childComplexity int) int
		ProfileImgURL        func(childComplexity int) int
		Role                 func(childComplexity int) int
		UpdatedAt            func(childComplexity int) int
		Weight               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, userInput model.UserInput) (*model.AuthData, error)
	ResetPassword(ctx context.Context, email string) (bool, error)
	PostMessage(ctx context.Context, user string, content string) (string, error)
}

type QueryResolver

type QueryResolver interface {
	Login(ctx context.Context, email string, password string) (*model.AuthData, error)
	Me(ctx context.Context) (*model.User, error)
	Messages(ctx context.Context) ([]*model.Message, error)
}

type Resolver

type Resolver struct {
	// All messages since launching the GraphQL endpoint
	ChatMessages []*model.Message
	// All active subscriptions
	ChatObservers map[string]chan []*model.Message
	// contains filtered or unexported fields
}

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

func (r *Resolver) Subscription() SubscriptionResolver

Subscription returns SubscriptionResolver implementation.

type ResolverRoot

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

type SubscriptionResolver

type SubscriptionResolver interface {
	Messages(ctx context.Context) (<-chan []*model.Message, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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