Documentation ¶
Index ¶
- type CtxKey
- type Post
- type Reaction
- func (rsv *Reaction) Author(ctx context.Context) (*User, error)
- func (rsv *Reaction) Creation() graphql.Time
- func (rsv *Reaction) Emotion() string
- func (rsv *Reaction) ID() store.ID
- func (rsv *Reaction) Message() string
- func (rsv *Reaction) Reactions(ctx context.Context) ([]*Reaction, error)
- func (rsv *Reaction) Subject(ctx context.Context) *ReactionSubject
- type ReactionSubject
- type Resolver
- func (rsv *Resolver) Authenticate(ctx context.Context, params struct{ ... }) *Session
- func (rsv *Resolver) CloseAllSessions(ctx context.Context, params struct{ ... }) []string
- func (rsv *Resolver) CloseSession(ctx context.Context, params struct{ ... }) bool
- func (rsv *Resolver) CreatePost(ctx context.Context, params struct{ ... }) *Post
- func (rsv *Resolver) CreateReaction(ctx context.Context, params struct{ ... }) *Reaction
- func (rsv *Resolver) CreateSession(ctx context.Context, params struct{ ... }) *Session
- func (rsv *Resolver) CreateUser(ctx context.Context, params struct{ ... }) *User
- func (rsv *Resolver) EditPost(ctx context.Context, params struct{ ... }) *Post
- func (rsv *Resolver) EditReaction(ctx context.Context, params struct{ ... }) *Reaction
- func (rsv *Resolver) EditUser(ctx context.Context, params struct{ ... }) *User
- func (rsv *Resolver) Post(ctx context.Context, params struct{ ... }) *Post
- func (rsv *Resolver) Posts(ctx context.Context) []*Post
- func (rsv *Resolver) Reaction(ctx context.Context, params struct{ ... }) *Reaction
- func (rsv *Resolver) User(ctx context.Context, params struct{ ... }) *User
- func (rsv *Resolver) Users(ctx context.Context) []*User
- type Session
- type User
- func (rsv *User) Creation() graphql.Time
- func (rsv *User) DisplayName() string
- func (rsv *User) Email(ctx context.Context) string
- func (rsv *User) ID() store.ID
- func (rsv *User) Posts(ctx context.Context) []*Post
- func (rsv *User) PublishedReactions(ctx context.Context) []*Reaction
- func (rsv *User) Sessions(ctx context.Context) []*Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CtxKey ¶
type CtxKey int
CtxKey represents a context.Context value key type
const CtxErrorRef CtxKey = 1
CtxErrorRef defines the context.Context error reference value key
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
Post represents the resolver of the identically named type
func (*Post) Author ¶
Author resolves Post.author
func (*Post) Reactions ¶
Reactions resolves Post.reactions
type Reaction ¶
type Reaction struct {
// contains filtered or unexported fields
}
Reaction represents the resolver of the identically named type
func (*Reaction) Author ¶
Author resolves Reaction.author
func (*Reaction) Creation ¶
func (rsv *Reaction) Creation() graphql.Time
Creation resolves Reaction.creation
func (*Reaction) Reactions ¶
Reactions resolves Reaction.reactions
func (*Reaction) Subject ¶
func (rsv *Reaction) Subject(ctx context.Context) *ReactionSubject
Subject resolves Reaction.subject
type ReactionSubject ¶
type ReactionSubject struct {
// contains filtered or unexported fields
}
ReactionSubject implements the identically named union type
func (*ReactionSubject) ToPost ¶
func (un *ReactionSubject) ToPost() (*Post, bool)
ToPost casts the union to a Post resolver
func (*ReactionSubject) ToReaction ¶
func (un *ReactionSubject) ToReaction() (*Reaction, bool)
ToReaction casts the union to a Reaction resolver
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver represents the root Graph resolver
func New ¶
func New( str store.Store, validator validator.Validator, sessionKeyGenerator sesskeygen.SessionKeyGenerator, passwordHasher passhash.PasswordHasher, ) (*Resolver, error)
New creates a new graph resolver instance
func (*Resolver) Authenticate ¶
func (rsv *Resolver) Authenticate( ctx context.Context, params struct { SessionKey string }, ) *Session
Authenticate resolves Mutation.authenticate
func (*Resolver) CloseAllSessions ¶
func (rsv *Resolver) CloseAllSessions( ctx context.Context, params struct { User string }, ) []string
CloseAllSessions resolves Mutation.closeAllSessions
func (*Resolver) CloseSession ¶
CloseSession resolves Mutation.closeSession
func (*Resolver) CreatePost ¶
func (rsv *Resolver) CreatePost( ctx context.Context, params struct { Author string Title string Contents string }, ) *Post
CreatePost resolves Mutation.createPost
func (*Resolver) CreateReaction ¶
func (rsv *Resolver) CreateReaction( ctx context.Context, params struct { Author string Subject string Emotion string Message string }, ) *Reaction
CreateReaction resolves Mutation.createReaction
func (*Resolver) CreateSession ¶
func (rsv *Resolver) CreateSession( ctx context.Context, params struct { Email string Password string }, ) *Session
CreateSession resolves Mutation.createSession
func (*Resolver) CreateUser ¶
func (rsv *Resolver) CreateUser( ctx context.Context, params struct { Email string DisplayName string Password string }, ) *User
CreateUser resolves Mutation.createUser
func (*Resolver) EditPost ¶
func (rsv *Resolver) EditPost( ctx context.Context, params struct { Post string Editor string NewTitle *string NewContents *string }, ) *Post
EditPost resolves Mutation.editPost
func (*Resolver) EditReaction ¶
func (rsv *Resolver) EditReaction( ctx context.Context, params struct { Reaction string Editor string NewMessage string }, ) *Reaction
EditReaction resolves Mutation.editReaction
func (*Resolver) EditUser ¶
func (rsv *Resolver) EditUser( ctx context.Context, params struct { User string Editor string NewEmail *string NewPassword *string }, ) *User
EditUser resolves Mutation.editUser
func (*Resolver) Post ¶
Post resolves Query.post
func (*Resolver) Posts ¶
Posts resolves Query.posts
func (*Resolver) Reaction ¶
Reaction resolves Query.reaction
func (*Resolver) User ¶
User resolves Query.user
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents the resolver of the identically named type
type User ¶
type User struct {
// contains filtered or unexported fields
}
User represents the resolver of the identically named type
func (*User) DisplayName ¶
DisplayName resolves User.displayName
func (*User) Posts ¶
Posts resolves User.posts
func (*User) PublishedReactions ¶
PublishedReactions resolves User.publishedReactions