resolvers

package
v0.0.0-...-5346628 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeResolver

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

NodeResolver contains the node for resolving

func (*NodeResolver) ID

func (n *NodeResolver) ID() graphql.ID

ID of the node

func (*NodeResolver) ToPost

func (n *NodeResolver) ToPost() (*PostResolver, bool)

ToPost resolves the node to a post

func (*NodeResolver) ToReview

func (n *NodeResolver) ToReview() (*ReviewResolver, bool)

ToReview resolves the node to a review

func (*NodeResolver) ToUser

func (n *NodeResolver) ToUser() (*UserResolver, bool)

ToUser resolves the node to a user

type PageInfo

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

PageInfo provides information to the edge for pagination

func (*PageInfo) EndCursor

func (p *PageInfo) EndCursor(ctx context.Context) *graphql.ID

EndCursor is the first id of the results, useful for pagination

func (*PageInfo) HasNextPage

func (p *PageInfo) HasNextPage(ctx context.Context) bool

HasNextPage tells if there's a next page when doing pagination

func (*PageInfo) HasPreviousPage

func (p *PageInfo) HasPreviousPage(ctx context.Context) bool

HasPreviousPage tells if there's a previous page when doing pagination

func (*PageInfo) StartCursor

func (p *PageInfo) StartCursor(ctx context.Context) *graphql.ID

StartCursor is the first id of the results, useful for pagination

type PostResolver

type PostResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

PostResolver contains the DB and the model for resolving

func (*PostResolver) ID

func (p *PostResolver) ID() graphql.ID

ID resolves the ID field for Post

func (*PostResolver) Reviews

Reviews is the resolver for Reviews belonging to a Post

func (*PostResolver) Title

func (p *PostResolver) Title() *string

Title resolves the title field for Post

type PostReviewsResolver

type PostReviewsResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

PostReviewsResolver contains the DB and the models for resolving the reviews of a post

func (*PostReviewsResolver) Edges

func (p *PostReviewsResolver) Edges(ctx context.Context) (*[]*ReviewEdge, error)

Edges gives a list of all the review edges that belong to a post

func (*PostReviewsResolver) PageInfo

func (p *PostReviewsResolver) PageInfo(ctx context.Context) (*PageInfo, error)

PageInfo resolves page info of a Review connection

type Query

type Query struct {
	DB *db.Services
}

Query contains the DB so it's made available in all resolvers

func (*Query) Node

func (q *Query) Node(args struct{ ID string }) (*NodeResolver, error)

Node is the top level node query resolver for relationships between services

func (*Query) Post

func (q *Query) Post(ctx context.Context, args struct{ ID *string }) (*PostResolver, error)

Post resolves the post query

func (*Query) Review

func (q *Query) Review(ctx context.Context, args struct{ ID *string }) (*ReviewResolver, error)

Review resolver

type ReviewEdge

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

ReviewEdge is the edge containing review nodes

func (*ReviewEdge) Cursor

func (r *ReviewEdge) Cursor(ctx context.Context) graphql.ID

Cursor resolves the Cursor of a Review

func (*ReviewEdge) Node

func (r *ReviewEdge) Node(ctx context.Context) *ReviewResolver

Node resolves the Node of a Review

type ReviewResolver

type ReviewResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

ReviewResolver contains the DB and the model for resolving

func (*ReviewResolver) ID

func (r *ReviewResolver) ID() graphql.ID

ID resolves the ID of a Review

func (*ReviewResolver) Post

func (r *ReviewResolver) Post(ctx context.Context) (*PostResolver, error)

Post resolves the post belonging to a Review

func (*ReviewResolver) Stars

func (r *ReviewResolver) Stars() *int32

Stars resolves the Stars of a review

type UserResolver

type UserResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

UserResolver contains the DB and the model for resolving

func (*UserResolver) CanWriteReviews

func (u *UserResolver) CanWriteReviews() bool

func (*UserResolver) ID

func (u *UserResolver) ID() graphql.ID

func (*UserResolver) Reviews

Reviews is the resolver for Reviews belonging to a Post

type UserReviewsResolver

type UserReviewsResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

UserReviewsResolver contains the DB and the models for resolving the reviews of a user

Jump to

Keyboard shortcuts

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