generated

package
v0.0.0-...-89ecaf8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 14 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 {
		CreateSurvey         func(childComplexity int, input models.NewSurvey) int
		CreateSurveyResponse func(childComplexity int, input models.NewSurveyResponse) int
	}

	Query struct {
		Survey          func(childComplexity int, id string) int
		SurveyResponse  func(childComplexity int, id string) int
		SurveyResponses func(childComplexity int) int
		Surveys         func(childComplexity int, limit *int, page *int) int
	}

	Subscription struct {
		SurveyCreated         func(childComplexity int) int
		SurveyResponseCreated func(childComplexity int) int
	}

	Survey struct {
		CreatedAt   func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
		Question    func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
	}

	SurveyResponse struct {
		Answer    func(childComplexity int) int
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		Rating    func(childComplexity int) int
		Survey    func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

func NewConfig

func NewConfig(resolver ResolverRoot) *Config

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateSurvey(ctx context.Context, input models.NewSurvey) (*models.Survey, error)
	CreateSurveyResponse(ctx context.Context, input models.NewSurveyResponse) (*models.SurveyResponse, error)
}

type QueryResolver

type QueryResolver interface {
	Surveys(ctx context.Context, limit *int, page *int) ([]*models.Survey, error)
	Survey(ctx context.Context, id string) (*models.Survey, error)
	SurveyResponses(ctx context.Context) ([]*models.SurveyResponse, error)
	SurveyResponse(ctx context.Context, id string) (*models.SurveyResponse, error)
}

type ResolverRoot

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

type SubscriptionResolver

type SubscriptionResolver interface {
	SurveyCreated(ctx context.Context) (<-chan *models.Survey, error)
	SurveyResponseCreated(ctx context.Context) (<-chan *models.SurveyResponse, error)
}

Jump to

Keyboard shortcuts

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