resolver

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func (rsv *Post) Author(ctx context.Context) *User

Author resolves Post.author

func (*Post) Contents

func (rsv *Post) Contents() string

Contents resolves Post.contents

func (*Post) Creation

func (rsv *Post) Creation() graphql.Time

Creation resolves Post.creation

func (*Post) ID

func (rsv *Post) ID() store.ID

ID resolves Post.id

func (*Post) Reactions

func (rsv *Post) Reactions(ctx context.Context) []*Reaction

Reactions resolves Post.reactions

func (*Post) Title

func (rsv *Post) Title() string

Title resolves Post.title

type Reaction

type Reaction struct {
	// contains filtered or unexported fields
}

Reaction represents the resolver of the identically named type

func (*Reaction) Author

func (rsv *Reaction) Author(ctx context.Context) (*User, error)

Author resolves Reaction.author

func (*Reaction) Creation

func (rsv *Reaction) Creation() graphql.Time

Creation resolves Reaction.creation

func (*Reaction) Emotion

func (rsv *Reaction) Emotion() string

Emotion resolves Reaction.emotion

func (*Reaction) ID

func (rsv *Reaction) ID() store.ID

ID resolves Reaction.id

func (*Reaction) Message

func (rsv *Reaction) Message() string

Message resolves Reaction.message

func (*Reaction) Reactions

func (rsv *Reaction) Reactions(ctx context.Context) ([]*Reaction, error)

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

func (rsv *Resolver) CloseSession(
	ctx context.Context,
	params struct {
		Key string
	},
) bool

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

func (rsv *Resolver) Post(
	ctx context.Context,
	params struct {
		ID string
	},
) *Post

Post resolves Query.post

func (*Resolver) Posts

func (rsv *Resolver) Posts(ctx context.Context) []*Post

Posts resolves Query.posts

func (*Resolver) Reaction

func (rsv *Resolver) Reaction(
	ctx context.Context,
	params struct {
		ID string
	},
) *Reaction

Reaction resolves Query.reaction

func (*Resolver) User

func (rsv *Resolver) User(
	ctx context.Context,
	params struct {
		ID string
	},
) *User

User resolves Query.user

func (*Resolver) Users

func (rsv *Resolver) Users(ctx context.Context) []*User

Users resolves Query.users

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents the resolver of the identically named type

func (*Session) Creation

func (rsv *Session) Creation() graphql.Time

Creation resolves Session.creation

func (*Session) Key

func (rsv *Session) Key() string

Key resolves Session.key

func (*Session) User

func (rsv *Session) User(
	ctx context.Context,
) *User

User resolves Session.user

type User

type User struct {
	// contains filtered or unexported fields
}

User represents the resolver of the identically named type

func (*User) Creation

func (rsv *User) Creation() graphql.Time

Creation resolves User.creation

func (*User) DisplayName

func (rsv *User) DisplayName() string

DisplayName resolves User.displayName

func (*User) Email

func (rsv *User) Email(ctx context.Context) string

Email resolves User.email

func (*User) ID

func (rsv *User) ID() store.ID

ID resolves User.id

func (*User) Posts

func (rsv *User) Posts(
	ctx context.Context,
) []*Post

Posts resolves User.posts

func (*User) PublishedReactions

func (rsv *User) PublishedReactions(
	ctx context.Context,
) []*Reaction

PublishedReactions resolves User.publishedReactions

func (*User) Sessions

func (rsv *User) Sessions(
	ctx context.Context,
) []*Session

Sessions resolves User.sessions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL