graphql

package
v0.0.0-...-4c09e60 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinContextFromContext

func GinContextFromContext(ctx context.Context) (*gin.Context, error)

GinContextFromContext gets gin.Context from resolver context

func GinContextToContextMiddleware

func GinContextToContextMiddleware() gin.HandlerFunc

GinContextToContextMiddleware is the middleware that add a context with key

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Mutation struct {
		CreateUser func(childComplexity int, input models.CreateUserInput) int
	}

	Paper struct {
		Authors      func(childComplexity int) int
		Date         func(childComplexity int) int
		Genre        func(childComplexity int) int
		IssueNumber  func(childComplexity int) int
		Journal      func(childComplexity int) int
		JournalName  func(childComplexity int) int
		Pagination   func(childComplexity int) int
		Title        func(childComplexity int) int
		VolumeNumber func(childComplexity int) int
	}

	Query struct {
		Paper       func(childComplexity int, title string) int
		Papers      func(childComplexity int) int
		Researcher  func(childComplexity int, name string) int
		Researchers func(childComplexity int) int
		User        func(childComplexity int, phone string) int
		Users       func(childComplexity int) int
	}

	Researcher struct {
		Name   func(childComplexity int) int
		Papers func(childComplexity int) int
	}

	User struct {
		Email        func(childComplexity int) int
		NickName     func(childComplexity int) int
		PasswordHash func(childComplexity int) int
		Phone        func(childComplexity int) int
		School       func(childComplexity int) int
		Username     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, input models.CreateUserInput) (*models.User, error)
}

type PaperResolver

type PaperResolver interface {
	Authors(ctx context.Context, obj *models.Paper) ([]*models.Researcher, error)
}

type QueryResolver

type QueryResolver interface {
	Users(ctx context.Context) ([]*models.User, error)
	User(ctx context.Context, phone string) (*models.User, error)
	Researchers(ctx context.Context) ([]*models.Researcher, error)
	Researcher(ctx context.Context, name string) (*models.Researcher, error)
	Papers(ctx context.Context) ([]*models.Paper, error)
	Paper(ctx context.Context, title string) (*models.Paper, error)
}

type ResearcherResolver

type ResearcherResolver interface {
	Papers(ctx context.Context, obj *models.Researcher) ([]*models.Paper, error)
}

type Resolver

type Resolver struct {
	Dg *dgo.Dgraph
}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Paper

func (r *Resolver) Paper() PaperResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) Researcher

func (r *Resolver) Researcher() ResearcherResolver

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Paper() PaperResolver
	Query() QueryResolver
	Researcher() ResearcherResolver
}

Jump to

Keyboard shortcuts

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