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 { LoginUser func(childComplexity int, input schemas.LoginUserInput) int RefreshTokens func(childComplexity int, input schemas.RefreshTokensInput) int RegisterUser func(childComplexity int, input schemas.RegisterUserInput) int } Query struct { Me func(childComplexity int, accessToken string) int User func(childComplexity int, id string) int Users func(childComplexity int) int } Tokens struct { AccessToken func(childComplexity int) int RefreshToken func(childComplexity int) int } User struct { CreatedAt func(childComplexity int) int Email func(childComplexity int) int ID func(childComplexity int) int UpdatedAt 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 { RegisterUser(ctx context.Context, input schemas.RegisterUserInput) (int, error) LoginUser(ctx context.Context, input schemas.LoginUserInput) (*entities.TokensDTO, error) RefreshTokens(ctx context.Context, input schemas.RefreshTokensInput) (*entities.TokensDTO, error) }
type QueryResolver ¶
type Resolver ¶
type Resolver struct { UseCases interfaces.UseCases Logger *slog.Logger }
Resolver
This file will not be regenerated automatically. It serves as dependency injection for your app, add any dependencies you require here.
https://stackoverflow.com/questions/62348857/unit-testing-graphql-in-golang
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.