2024-06-26 01:45:04 +00:00
|
|
|
package graph
|
|
|
|
|
|
|
|
// This file will be automatically regenerated based on the schema, any resolver implementations
|
|
|
|
// will be copied through when generating and any unknown code will be moved to the end.
|
|
|
|
// Code generated by github.com/99designs/gqlgen version v0.17.49
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"git.obamna.ru/erius/ozon-task/graph/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Replies is the resolver for the replies field.
|
2024-06-27 01:28:18 +00:00
|
|
|
func (r *commentResolver) Replies(ctx context.Context, obj *model.Comment, first uint, after *uint) (*model.CommentsConnection, error) {
|
2024-06-26 01:45:04 +00:00
|
|
|
return r.Storage.GetReplies(obj, first, after, ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comments is the resolver for the comments field.
|
2024-06-27 01:28:18 +00:00
|
|
|
func (r *postResolver) Comments(ctx context.Context, obj *model.Post, first uint, after *uint) (*model.CommentsConnection, error) {
|
2024-06-26 01:45:04 +00:00
|
|
|
return r.Storage.GetComments(obj, first, after, ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Post is the resolver for the post field.
|
|
|
|
func (r *queryResolver) Post(ctx context.Context, id uint) (*model.Post, error) {
|
|
|
|
return r.Storage.GetPost(id, ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Posts is the resolver for the posts field.
|
2024-06-27 01:28:18 +00:00
|
|
|
func (r *queryResolver) Posts(ctx context.Context, first uint, after *uint) (*model.PostsConnection, error) {
|
2024-06-26 01:45:04 +00:00
|
|
|
return r.Storage.GetPosts(first, after, ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comment is the resolver for the comment field.
|
|
|
|
func (r *queryResolver) Comment(ctx context.Context, id uint) (*model.Comment, error) {
|
|
|
|
return r.Storage.GetComment(id, ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comment returns CommentResolver implementation.
|
|
|
|
func (r *Resolver) Comment() CommentResolver { return &commentResolver{r} }
|
|
|
|
|
|
|
|
// Post returns PostResolver implementation.
|
|
|
|
func (r *Resolver) Post() PostResolver { return &postResolver{r} }
|
|
|
|
|
|
|
|
// Query returns QueryResolver implementation.
|
|
|
|
func (r *Resolver) Query() QueryResolver { return &queryResolver{r} }
|
|
|
|
|
|
|
|
type commentResolver struct{ *Resolver }
|
|
|
|
type postResolver struct{ *Resolver }
|
|
|
|
type queryResolver struct{ *Resolver }
|