Documentation ¶
Index ¶
- func GinContextFromContext(ctx context.Context) (*gin.Context, error)
- func GinContextToContextMiddleware() gin.HandlerFunc
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type MutationResolver
- type PaperResolver
- type QueryResolver
- type ResearcherResolver
- type Resolver
- type ResolverRoot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinContextFromContext ¶
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 PaperResolver ¶
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 Resolver ¶
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 }
Click to show internal directories.
Click to hide internal directories.