Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type AuthPayload
- type Captcha
- type CheckSms
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type Friendships
- type MutationResolver
- type PhoneInput
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Result
- type Role
- type SearchUser
- type Sms
- type UserInformation
- type UserRegistration
Constants ¶
This section is empty.
Variables ¶
View Source
var AllRole = []Role{ RoleGeneralUser, RoleAdmin, }
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type AuthPayload ¶
type ComplexityRoot ¶
type ComplexityRoot struct { AuthPayload struct { AccessTokenString func(childComplexity int) int UserID func(childComplexity int) int } Captcha struct { Base64Captcha func(childComplexity int) int CaptchaID func(childComplexity int) int } CheckSMS struct { Ok func(childComplexity int) int } Friendships struct { Friendships func(childComplexity int) int } Mutation struct { Healthcheck func(childComplexity int) int SendSms func(childComplexity int, input *PhoneInput) int UploadFile func(childComplexity int, file graphql.Upload) int UserRegistration func(childComplexity int, input *UserRegistration) int } Query struct { Captcha func(childComplexity int) int CheckSms func(childComplexity int, smsID string, smsCode string) int Friendship func(childComplexity int) int Healthcheck func(childComplexity int) int Now func(childComplexity int) int SearchUser func(childComplexity int, keyword string) int User func(childComplexity int) int UserLogin func(childComplexity int, smsID string, smsCode string) int } Result struct { Ok func(childComplexity int) int } SMS struct { SmsID func(childComplexity int) int } SearchUser struct { Users func(childComplexity int) int } UserInformation struct { About func(childComplexity int) int Account func(childComplexity int) int AccountID func(childComplexity int) int Avatar func(childComplexity int) int Birthday func(childComplexity int) int Email func(childComplexity int) int FullName func(childComplexity int) int NickName func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type Friendships ¶
type Friendships struct {
Friendships []UserInformation `json:"friendships"`
}
type MutationResolver ¶
type MutationResolver interface { Healthcheck(ctx context.Context) (string, error) UploadFile(ctx context.Context, file graphql.Upload) (string, error) SendSms(ctx context.Context, input *PhoneInput) (*Sms, error) UserRegistration(ctx context.Context, input *UserRegistration) (*AuthPayload, error) }
type PhoneInput ¶
type PhoneInput struct {
PhoneNumber string `json:"phoneNumber"`
}
type QueryResolver ¶
type QueryResolver interface { Healthcheck(ctx context.Context) (string, error) Now(ctx context.Context) (*timestamppb.Timestamp, error) User(ctx context.Context) (*UserInformation, error) CheckSms(ctx context.Context, smsID string, smsCode string) (*CheckSms, error) Captcha(ctx context.Context) (*Captcha, error) UserLogin(ctx context.Context, smsID string, smsCode string) (*AuthPayload, error) Friendship(ctx context.Context) (*Friendships, error) SearchUser(ctx context.Context, keyword string) (*SearchUser, error) }
type Resolver ¶
type Resolver struct{}
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 }
type SearchUser ¶
type SearchUser struct {
Users []UserInformation `json:"users"`
}
type UserInformation ¶
type UserRegistration ¶
Click to show internal directories.
Click to hide internal directories.