graph

package
v0.0.0-...-3273997 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 21 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 {
	FeedArticle struct {
		Author        func(childComplexity int) int
		Content       func(childComplexity int) int
		Created       func(childComplexity int) int
		Description   func(childComplexity int) int
		Image         func(childComplexity int) int
		Link          func(childComplexity int) int
		Published     func(childComplexity int) int
		ResourceID    func(childComplexity int) int
		ResourceTitle func(childComplexity int) int
		Title         func(childComplexity int) int
	}

	FeedResource struct {
		Active    func(childComplexity int) int
		Created   func(childComplexity int) int
		Modified  func(childComplexity int) int
		Published func(childComplexity int) int
		Title     func(childComplexity int) int
		URL       func(childComplexity int) int
	}

	Mutation struct {
		ActivateResources func(childComplexity int, urls []string, active bool) int
		AddResources      func(childComplexity int, resources []*model.NewResource) int
		RemoveResources   func(childComplexity int, urls []string) int
	}

	Query struct {
		Articles  func(childComplexity int, after time.Time) int
		Resources func(childComplexity int, active bool) int
	}

	Subscription struct {
		Articles func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	AddResources(ctx context.Context, resources []*model.NewResource) (*string, error)
	RemoveResources(ctx context.Context, urls []string) (*string, error)
	ActivateResources(ctx context.Context, urls []string, active bool) (*string, error)
}

type QueryResolver

type QueryResolver interface {
	Resources(ctx context.Context, active bool) ([]*model.FeedResource, error)
	Articles(ctx context.Context, after time.Time) ([]*model.FeedArticle, error)
}

type Resolver

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 {
	Articles(ctx context.Context) (<-chan []*model.FeedArticle, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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