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) 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) HasNextPage ¶
HasNextPage tells if there's a next page when doing pagination
func (*PageInfo) HasPreviousPage ¶
HasPreviousPage tells if there's a previous page when doing pagination
func (*PageInfo) StartCursor ¶
StartCursor is the first id of the results, useful for pagination
type PostResolver ¶
PostResolver contains the DB and the model for resolving
func (*PostResolver) Reviews ¶
func (p *PostResolver) Reviews(ctx context.Context) (*PostReviewsResolver, error)
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 ¶
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
type Query ¶
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
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 ¶
ReviewResolver contains the DB and the model for resolving
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 ¶
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 ¶
func (p *UserResolver) Reviews(ctx context.Context) (*PostReviewsResolver, error)
Reviews is the resolver for Reviews belonging to a Post
type UserReviewsResolver ¶
UserReviewsResolver contains the DB and the models for resolving the reviews of a user