Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllUserGender = []UserGender{ UserGenderMale, UserGenderFemale, }
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 {
ChangePassword func(childComplexity int, email string, newPassword string) int
CreateUser func(childComplexity int, input UserInput) int
DeleteUser func(childComplexity int, id string) int
VerifyUser func(childComplexity int, email string) int
}
Query struct {
GetUser func(childComplexity int, email string) int
Login func(childComplexity int, email string, password string) int
}
User struct {
Email func(childComplexity int) int
EmailVerified func(childComplexity int) int
ID func(childComplexity int) int
PasswordHash func(childComplexity int) int
UpdatedAt 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 UserInput) (*User, error)
DeleteUser(ctx context.Context, id string) (*User, error)
VerifyUser(ctx context.Context, email string) (*User, error)
ChangePassword(ctx context.Context, email string, newPassword string) (*User, error)
}
type QueryResolver ¶
type Resolver ¶
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
}
type User ¶
type User struct {
ID string `json:"id" gorm:"primary_key"`
Email string `json:"email" gorm:"unique"`
PasswordHash string `json:"passwordHash"`
EmailVerified bool `json:"email_verified"`
UpdatedAt time.Time `json:"updated_at"`
}
func (*User) UpdatePassword ¶
UpdatePassword hash password and assign it to pass word attribute
func (User) ValidatePassword ¶
ValidatePassword compare password hashes
type UserGender ¶
type UserGender string
const ( UserGenderMale UserGender = "male" UserGenderFemale UserGender = "female" )
func (UserGender) IsValid ¶
func (e UserGender) IsValid() bool
func (UserGender) MarshalGQL ¶
func (e UserGender) MarshalGQL(w io.Writer)
func (UserGender) String ¶
func (e UserGender) String() string
func (*UserGender) UnmarshalGQL ¶
func (e *UserGender) UnmarshalGQL(v interface{}) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.