erius
e0aa12b126
Removed unnecesary bindings for ID and Int in gqlgen.yml Minor changes to Makefile docker-clean target Reduced docker-compose postgres healthcheck interval for faster local db connections Added pagination to graphql schema, the paginated queries are WIP Removed unneeded fields from the model structs Added allowComment check when adding comments Switched gorm logger to Info mode App now panics if the specified APP_STORAGE in env doesn't exist Reworked database methods, still barely working and are WIP
49 lines
1.8 KiB
Go
49 lines
1.8 KiB
Go
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.
|
|
func (r *commentResolver) Replies(ctx context.Context, obj *model.Comment, first uint, after uint) (*model.CommentsConnection, error) {
|
|
return r.Storage.GetReplies(obj, first, after, ctx)
|
|
}
|
|
|
|
// Comments is the resolver for the comments field.
|
|
func (r *postResolver) Comments(ctx context.Context, obj *model.Post, first uint, after uint) (*model.CommentsConnection, error) {
|
|
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.
|
|
func (r *queryResolver) Posts(ctx context.Context, first uint, after uint) (*model.PostsConnection, error) {
|
|
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 }
|