9182 lines
266 KiB
Go
9182 lines
266 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package graph
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"embed"
|
|
"errors"
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
"sync"
|
|
"sync/atomic"
|
|
"tailly_back_v2/internal/domain"
|
|
|
|
"github.com/99designs/gqlgen/graphql"
|
|
"github.com/99designs/gqlgen/graphql/introspection"
|
|
gqlparser "github.com/vektah/gqlparser/v2"
|
|
"github.com/vektah/gqlparser/v2/ast"
|
|
)
|
|
|
|
// region ************************** generated!.gotpl **************************
|
|
|
|
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
|
|
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
|
|
return &executableSchema{
|
|
schema: cfg.Schema,
|
|
resolvers: cfg.Resolvers,
|
|
directives: cfg.Directives,
|
|
complexity: cfg.Complexity,
|
|
}
|
|
}
|
|
|
|
type Config struct {
|
|
Schema *ast.Schema
|
|
Resolvers ResolverRoot
|
|
Directives DirectiveRoot
|
|
Complexity ComplexityRoot
|
|
}
|
|
|
|
type ResolverRoot interface {
|
|
ChatSession() ChatSessionResolver
|
|
Comment() CommentResolver
|
|
Like() LikeResolver
|
|
Message() MessageResolver
|
|
Mutation() MutationResolver
|
|
Post() PostResolver
|
|
Query() QueryResolver
|
|
Subscription() SubscriptionResolver
|
|
User() UserResolver
|
|
}
|
|
|
|
type DirectiveRoot struct {
|
|
}
|
|
|
|
type ComplexityRoot struct {
|
|
ChatSession struct {
|
|
LastMessage func(childComplexity int) int
|
|
UnreadCount func(childComplexity int) int
|
|
User func(childComplexity int) int
|
|
}
|
|
|
|
Comment struct {
|
|
Author func(childComplexity int) int
|
|
Content func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Post func(childComplexity int) int
|
|
UpdatedAt func(childComplexity int) int
|
|
}
|
|
|
|
Like struct {
|
|
CreatedAt func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Post func(childComplexity int) int
|
|
User func(childComplexity int) int
|
|
}
|
|
|
|
Message struct {
|
|
Content func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Receiver func(childComplexity int) int
|
|
Sender func(childComplexity int) int
|
|
Status func(childComplexity int) int
|
|
}
|
|
|
|
Mutation struct {
|
|
ChangePassword func(childComplexity int, oldPassword string, newPassword string) int
|
|
CreateComment func(childComplexity int, postID string, content string) int
|
|
CreatePost func(childComplexity int, title string, content string) int
|
|
LikePost func(childComplexity int, postID string) int
|
|
Login func(childComplexity int, input domain.LoginInput) int
|
|
MarkAsRead func(childComplexity int, messageID string) int
|
|
RefreshTokens func(childComplexity int, refreshToken string) int
|
|
Register func(childComplexity int, input domain.RegisterInput) int
|
|
SendMessage func(childComplexity int, receiverID string, content string) int
|
|
UnlikePost func(childComplexity int, postID string) int
|
|
UpdateProfile func(childComplexity int, username string, email string) int
|
|
}
|
|
|
|
Post struct {
|
|
Author func(childComplexity int) int
|
|
Comments func(childComplexity int) int
|
|
Content func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
IsLiked func(childComplexity int) int
|
|
Likes func(childComplexity int) int
|
|
LikesCount func(childComplexity int) int
|
|
Title func(childComplexity int) int
|
|
UpdatedAt func(childComplexity int) int
|
|
}
|
|
|
|
Query struct {
|
|
GetChatHistory func(childComplexity int, userID string) int
|
|
GetUserChats func(childComplexity int) int
|
|
Me func(childComplexity int) int
|
|
Post func(childComplexity int, id string) int
|
|
Posts func(childComplexity int) int
|
|
User func(childComplexity int, id string) int
|
|
}
|
|
|
|
Subscription struct {
|
|
MessageReceived func(childComplexity int) int
|
|
}
|
|
|
|
Tokens struct {
|
|
AccessToken func(childComplexity int) int
|
|
RefreshToken func(childComplexity int) int
|
|
}
|
|
|
|
User struct {
|
|
CreatedAt func(childComplexity int) int
|
|
Email func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
UpdatedAt func(childComplexity int) int
|
|
Username func(childComplexity int) int
|
|
}
|
|
}
|
|
|
|
type ChatSessionResolver interface {
|
|
User(ctx context.Context, obj *domain.ChatSession) (*domain.User, error)
|
|
LastMessage(ctx context.Context, obj *domain.ChatSession) (*domain.Message, error)
|
|
UnreadCount(ctx context.Context, obj *domain.ChatSession) (int, error)
|
|
}
|
|
type CommentResolver interface {
|
|
Post(ctx context.Context, obj *domain.Comment) (*domain.Post, error)
|
|
Author(ctx context.Context, obj *domain.Comment) (*domain.User, error)
|
|
CreatedAt(ctx context.Context, obj *domain.Comment) (string, error)
|
|
UpdatedAt(ctx context.Context, obj *domain.Comment) (string, error)
|
|
}
|
|
type LikeResolver interface {
|
|
Post(ctx context.Context, obj *domain.Like) (*domain.Post, error)
|
|
User(ctx context.Context, obj *domain.Like) (*domain.User, error)
|
|
CreatedAt(ctx context.Context, obj *domain.Like) (string, error)
|
|
}
|
|
type MessageResolver interface {
|
|
Sender(ctx context.Context, obj *domain.Message) (*domain.User, error)
|
|
Receiver(ctx context.Context, obj *domain.Message) (*domain.User, error)
|
|
|
|
CreatedAt(ctx context.Context, obj *domain.Message) (string, error)
|
|
}
|
|
type MutationResolver interface {
|
|
Register(ctx context.Context, input domain.RegisterInput) (*domain.User, error)
|
|
Login(ctx context.Context, input domain.LoginInput) (*domain.Tokens, error)
|
|
RefreshTokens(ctx context.Context, refreshToken string) (*domain.Tokens, error)
|
|
CreatePost(ctx context.Context, title string, content string) (*domain.Post, error)
|
|
CreateComment(ctx context.Context, postID string, content string) (*domain.Comment, error)
|
|
LikePost(ctx context.Context, postID string) (*domain.Like, error)
|
|
UnlikePost(ctx context.Context, postID string) (bool, error)
|
|
UpdateProfile(ctx context.Context, username string, email string) (*domain.User, error)
|
|
ChangePassword(ctx context.Context, oldPassword string, newPassword string) (bool, error)
|
|
SendMessage(ctx context.Context, receiverID string, content string) (*domain.Message, error)
|
|
MarkAsRead(ctx context.Context, messageID string) (bool, error)
|
|
}
|
|
type PostResolver interface {
|
|
Author(ctx context.Context, obj *domain.Post) (*domain.User, error)
|
|
Comments(ctx context.Context, obj *domain.Post) ([]*domain.Comment, error)
|
|
Likes(ctx context.Context, obj *domain.Post) ([]*domain.Like, error)
|
|
LikesCount(ctx context.Context, obj *domain.Post) (int, error)
|
|
IsLiked(ctx context.Context, obj *domain.Post) (bool, error)
|
|
CreatedAt(ctx context.Context, obj *domain.Post) (string, error)
|
|
UpdatedAt(ctx context.Context, obj *domain.Post) (string, error)
|
|
}
|
|
type QueryResolver interface {
|
|
Me(ctx context.Context) (*domain.User, error)
|
|
Post(ctx context.Context, id string) (*domain.Post, error)
|
|
Posts(ctx context.Context) ([]*domain.Post, error)
|
|
User(ctx context.Context, id string) (*domain.User, error)
|
|
GetChatHistory(ctx context.Context, userID string) ([]*domain.Message, error)
|
|
GetUserChats(ctx context.Context) ([]*domain.ChatSession, error)
|
|
}
|
|
type SubscriptionResolver interface {
|
|
MessageReceived(ctx context.Context) (<-chan *domain.Message, error)
|
|
}
|
|
type UserResolver interface {
|
|
CreatedAt(ctx context.Context, obj *domain.User) (string, error)
|
|
UpdatedAt(ctx context.Context, obj *domain.User) (string, error)
|
|
}
|
|
|
|
type executableSchema struct {
|
|
schema *ast.Schema
|
|
resolvers ResolverRoot
|
|
directives DirectiveRoot
|
|
complexity ComplexityRoot
|
|
}
|
|
|
|
func (e *executableSchema) Schema() *ast.Schema {
|
|
if e.schema != nil {
|
|
return e.schema
|
|
}
|
|
return parsedSchema
|
|
}
|
|
|
|
func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) {
|
|
ec := executionContext{nil, e, 0, 0, nil}
|
|
_ = ec
|
|
switch typeName + "." + field {
|
|
|
|
case "ChatSession.lastMessage":
|
|
if e.complexity.ChatSession.LastMessage == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ChatSession.LastMessage(childComplexity), true
|
|
|
|
case "ChatSession.unreadCount":
|
|
if e.complexity.ChatSession.UnreadCount == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ChatSession.UnreadCount(childComplexity), true
|
|
|
|
case "ChatSession.user":
|
|
if e.complexity.ChatSession.User == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ChatSession.User(childComplexity), true
|
|
|
|
case "Comment.author":
|
|
if e.complexity.Comment.Author == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.Author(childComplexity), true
|
|
|
|
case "Comment.content":
|
|
if e.complexity.Comment.Content == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.Content(childComplexity), true
|
|
|
|
case "Comment.createdAt":
|
|
if e.complexity.Comment.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.CreatedAt(childComplexity), true
|
|
|
|
case "Comment.id":
|
|
if e.complexity.Comment.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.ID(childComplexity), true
|
|
|
|
case "Comment.post":
|
|
if e.complexity.Comment.Post == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.Post(childComplexity), true
|
|
|
|
case "Comment.updatedAt":
|
|
if e.complexity.Comment.UpdatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Comment.UpdatedAt(childComplexity), true
|
|
|
|
case "Like.createdAt":
|
|
if e.complexity.Like.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Like.CreatedAt(childComplexity), true
|
|
|
|
case "Like.id":
|
|
if e.complexity.Like.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Like.ID(childComplexity), true
|
|
|
|
case "Like.post":
|
|
if e.complexity.Like.Post == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Like.Post(childComplexity), true
|
|
|
|
case "Like.user":
|
|
if e.complexity.Like.User == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Like.User(childComplexity), true
|
|
|
|
case "Message.content":
|
|
if e.complexity.Message.Content == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.Content(childComplexity), true
|
|
|
|
case "Message.createdAt":
|
|
if e.complexity.Message.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.CreatedAt(childComplexity), true
|
|
|
|
case "Message.id":
|
|
if e.complexity.Message.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.ID(childComplexity), true
|
|
|
|
case "Message.receiver":
|
|
if e.complexity.Message.Receiver == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.Receiver(childComplexity), true
|
|
|
|
case "Message.sender":
|
|
if e.complexity.Message.Sender == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.Sender(childComplexity), true
|
|
|
|
case "Message.status":
|
|
if e.complexity.Message.Status == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Message.Status(childComplexity), true
|
|
|
|
case "Mutation.changePassword":
|
|
if e.complexity.Mutation.ChangePassword == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_changePassword_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.ChangePassword(childComplexity, args["oldPassword"].(string), args["newPassword"].(string)), true
|
|
|
|
case "Mutation.createComment":
|
|
if e.complexity.Mutation.CreateComment == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createComment_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreateComment(childComplexity, args["postId"].(string), args["content"].(string)), true
|
|
|
|
case "Mutation.createPost":
|
|
if e.complexity.Mutation.CreatePost == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createPost_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreatePost(childComplexity, args["title"].(string), args["content"].(string)), true
|
|
|
|
case "Mutation.likePost":
|
|
if e.complexity.Mutation.LikePost == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_likePost_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.LikePost(childComplexity, args["postId"].(string)), true
|
|
|
|
case "Mutation.login":
|
|
if e.complexity.Mutation.Login == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_login_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.Login(childComplexity, args["input"].(domain.LoginInput)), true
|
|
|
|
case "Mutation.markAsRead":
|
|
if e.complexity.Mutation.MarkAsRead == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_markAsRead_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.MarkAsRead(childComplexity, args["messageId"].(string)), true
|
|
|
|
case "Mutation.refreshTokens":
|
|
if e.complexity.Mutation.RefreshTokens == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_refreshTokens_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.RefreshTokens(childComplexity, args["refreshToken"].(string)), true
|
|
|
|
case "Mutation.register":
|
|
if e.complexity.Mutation.Register == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_register_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.Register(childComplexity, args["input"].(domain.RegisterInput)), true
|
|
|
|
case "Mutation.sendMessage":
|
|
if e.complexity.Mutation.SendMessage == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_sendMessage_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.SendMessage(childComplexity, args["receiverId"].(string), args["content"].(string)), true
|
|
|
|
case "Mutation.unlikePost":
|
|
if e.complexity.Mutation.UnlikePost == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_unlikePost_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UnlikePost(childComplexity, args["postId"].(string)), true
|
|
|
|
case "Mutation.updateProfile":
|
|
if e.complexity.Mutation.UpdateProfile == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateProfile_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateProfile(childComplexity, args["username"].(string), args["email"].(string)), true
|
|
|
|
case "Post.author":
|
|
if e.complexity.Post.Author == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.Author(childComplexity), true
|
|
|
|
case "Post.comments":
|
|
if e.complexity.Post.Comments == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.Comments(childComplexity), true
|
|
|
|
case "Post.content":
|
|
if e.complexity.Post.Content == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.Content(childComplexity), true
|
|
|
|
case "Post.createdAt":
|
|
if e.complexity.Post.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.CreatedAt(childComplexity), true
|
|
|
|
case "Post.id":
|
|
if e.complexity.Post.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.ID(childComplexity), true
|
|
|
|
case "Post.isLiked":
|
|
if e.complexity.Post.IsLiked == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.IsLiked(childComplexity), true
|
|
|
|
case "Post.likes":
|
|
if e.complexity.Post.Likes == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.Likes(childComplexity), true
|
|
|
|
case "Post.likesCount":
|
|
if e.complexity.Post.LikesCount == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.LikesCount(childComplexity), true
|
|
|
|
case "Post.title":
|
|
if e.complexity.Post.Title == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.Title(childComplexity), true
|
|
|
|
case "Post.updatedAt":
|
|
if e.complexity.Post.UpdatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Post.UpdatedAt(childComplexity), true
|
|
|
|
case "Query.getChatHistory":
|
|
if e.complexity.Query.GetChatHistory == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_getChatHistory_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.GetChatHistory(childComplexity, args["userId"].(string)), true
|
|
|
|
case "Query.getUserChats":
|
|
if e.complexity.Query.GetUserChats == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Query.GetUserChats(childComplexity), true
|
|
|
|
case "Query.me":
|
|
if e.complexity.Query.Me == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Query.Me(childComplexity), true
|
|
|
|
case "Query.post":
|
|
if e.complexity.Query.Post == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_post_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Post(childComplexity, args["id"].(string)), true
|
|
|
|
case "Query.posts":
|
|
if e.complexity.Query.Posts == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Query.Posts(childComplexity), true
|
|
|
|
case "Query.user":
|
|
if e.complexity.Query.User == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_user_args(ctx, rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.User(childComplexity, args["id"].(string)), true
|
|
|
|
case "Subscription.messageReceived":
|
|
if e.complexity.Subscription.MessageReceived == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Subscription.MessageReceived(childComplexity), true
|
|
|
|
case "Tokens.accessToken":
|
|
if e.complexity.Tokens.AccessToken == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Tokens.AccessToken(childComplexity), true
|
|
|
|
case "Tokens.refreshToken":
|
|
if e.complexity.Tokens.RefreshToken == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Tokens.RefreshToken(childComplexity), true
|
|
|
|
case "User.createdAt":
|
|
if e.complexity.User.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.CreatedAt(childComplexity), true
|
|
|
|
case "User.email":
|
|
if e.complexity.User.Email == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.Email(childComplexity), true
|
|
|
|
case "User.id":
|
|
if e.complexity.User.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.ID(childComplexity), true
|
|
|
|
case "User.updatedAt":
|
|
if e.complexity.User.UpdatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.UpdatedAt(childComplexity), true
|
|
|
|
case "User.username":
|
|
if e.complexity.User.Username == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.Username(childComplexity), true
|
|
|
|
}
|
|
return 0, false
|
|
}
|
|
|
|
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
|
|
opCtx := graphql.GetOperationContext(ctx)
|
|
ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)}
|
|
inputUnmarshalMap := graphql.BuildUnmarshalerMap(
|
|
ec.unmarshalInputLoginInput,
|
|
ec.unmarshalInputRegisterInput,
|
|
)
|
|
first := true
|
|
|
|
switch opCtx.Operation.Operation {
|
|
case ast.Query:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
var response graphql.Response
|
|
var data graphql.Marshaler
|
|
if first {
|
|
first = false
|
|
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
|
|
data = ec._Query(ctx, opCtx.Operation.SelectionSet)
|
|
} else {
|
|
if atomic.LoadInt32(&ec.pendingDeferred) > 0 {
|
|
result := <-ec.deferredResults
|
|
atomic.AddInt32(&ec.pendingDeferred, -1)
|
|
data = result.Result
|
|
response.Path = result.Path
|
|
response.Label = result.Label
|
|
response.Errors = result.Errors
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
response.Data = buf.Bytes()
|
|
if atomic.LoadInt32(&ec.deferred) > 0 {
|
|
hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0
|
|
response.HasNext = &hasNext
|
|
}
|
|
|
|
return &response
|
|
}
|
|
case ast.Mutation:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
if !first {
|
|
return nil
|
|
}
|
|
first = false
|
|
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
|
|
data := ec._Mutation(ctx, opCtx.Operation.SelectionSet)
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
case ast.Subscription:
|
|
next := ec._Subscription(ctx, opCtx.Operation.SelectionSet)
|
|
|
|
var buf bytes.Buffer
|
|
return func(ctx context.Context) *graphql.Response {
|
|
buf.Reset()
|
|
data := next(ctx)
|
|
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
|
|
default:
|
|
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
|
|
}
|
|
}
|
|
|
|
type executionContext struct {
|
|
*graphql.OperationContext
|
|
*executableSchema
|
|
deferred int32
|
|
pendingDeferred int32
|
|
deferredResults chan graphql.DeferredResult
|
|
}
|
|
|
|
func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) {
|
|
atomic.AddInt32(&ec.pendingDeferred, 1)
|
|
go func() {
|
|
ctx := graphql.WithFreshResponseContext(dg.Context)
|
|
dg.FieldSet.Dispatch(ctx)
|
|
ds := graphql.DeferredResult{
|
|
Path: dg.Path,
|
|
Label: dg.Label,
|
|
Result: dg.FieldSet,
|
|
Errors: graphql.GetErrors(ctx),
|
|
}
|
|
// null fields should bubble up
|
|
if dg.FieldSet.Invalids > 0 {
|
|
ds.Result = graphql.Null
|
|
}
|
|
ec.deferredResults <- ds
|
|
}()
|
|
}
|
|
|
|
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapSchema(ec.Schema()), nil
|
|
}
|
|
|
|
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil
|
|
}
|
|
|
|
//go:embed "schema.graphql"
|
|
var sourcesFS embed.FS
|
|
|
|
func sourceData(filename string) string {
|
|
data, err := sourcesFS.ReadFile(filename)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("codegen problem: %s not available", filename))
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
var sources = []*ast.Source{
|
|
{Name: "schema.graphql", Input: sourceData("schema.graphql"), BuiltIn: false},
|
|
}
|
|
var parsedSchema = gqlparser.MustLoadSchema(sources...)
|
|
|
|
// endregion ************************** generated!.gotpl **************************
|
|
|
|
// region ***************************** args.gotpl *****************************
|
|
|
|
func (ec *executionContext) field_Mutation_changePassword_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_changePassword_argsOldPassword(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["oldPassword"] = arg0
|
|
arg1, err := ec.field_Mutation_changePassword_argsNewPassword(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["newPassword"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_changePassword_argsOldPassword(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["oldPassword"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("oldPassword"))
|
|
if tmp, ok := rawArgs["oldPassword"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_changePassword_argsNewPassword(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["newPassword"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("newPassword"))
|
|
if tmp, ok := rawArgs["newPassword"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createComment_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_createComment_argsPostID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["postId"] = arg0
|
|
arg1, err := ec.field_Mutation_createComment_argsContent(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["content"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_createComment_argsPostID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["postId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("postId"))
|
|
if tmp, ok := rawArgs["postId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createComment_argsContent(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["content"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("content"))
|
|
if tmp, ok := rawArgs["content"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createPost_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_createPost_argsTitle(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["title"] = arg0
|
|
arg1, err := ec.field_Mutation_createPost_argsContent(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["content"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_createPost_argsTitle(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["title"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
if tmp, ok := rawArgs["title"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createPost_argsContent(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["content"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("content"))
|
|
if tmp, ok := rawArgs["content"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_likePost_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_likePost_argsPostID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["postId"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_likePost_argsPostID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["postId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("postId"))
|
|
if tmp, ok := rawArgs["postId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_login_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_login_argsInput(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_login_argsInput(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (domain.LoginInput, error) {
|
|
if _, ok := rawArgs["input"]; !ok {
|
|
var zeroVal domain.LoginInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
return ec.unmarshalNLoginInput2tailly_back_v2ᚋinternalᚋdomainᚐLoginInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal domain.LoginInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_markAsRead_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_markAsRead_argsMessageID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["messageId"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_markAsRead_argsMessageID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["messageId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("messageId"))
|
|
if tmp, ok := rawArgs["messageId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_refreshTokens_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_refreshTokens_argsRefreshToken(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["refreshToken"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_refreshTokens_argsRefreshToken(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["refreshToken"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("refreshToken"))
|
|
if tmp, ok := rawArgs["refreshToken"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_register_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_register_argsInput(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_register_argsInput(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (domain.RegisterInput, error) {
|
|
if _, ok := rawArgs["input"]; !ok {
|
|
var zeroVal domain.RegisterInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
return ec.unmarshalNRegisterInput2tailly_back_v2ᚋinternalᚋdomainᚐRegisterInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal domain.RegisterInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_sendMessage_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_sendMessage_argsReceiverID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["receiverId"] = arg0
|
|
arg1, err := ec.field_Mutation_sendMessage_argsContent(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["content"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_sendMessage_argsReceiverID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["receiverId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("receiverId"))
|
|
if tmp, ok := rawArgs["receiverId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_sendMessage_argsContent(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["content"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("content"))
|
|
if tmp, ok := rawArgs["content"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_unlikePost_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_unlikePost_argsPostID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["postId"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_unlikePost_argsPostID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["postId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("postId"))
|
|
if tmp, ok := rawArgs["postId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateProfile_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Mutation_updateProfile_argsUsername(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["username"] = arg0
|
|
arg1, err := ec.field_Mutation_updateProfile_argsEmail(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["email"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_updateProfile_argsUsername(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["username"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))
|
|
if tmp, ok := rawArgs["username"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateProfile_argsEmail(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["email"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
if tmp, ok := rawArgs["email"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Query___type_argsName(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["name"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query___type_argsName(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["name"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
if tmp, ok := rawArgs["name"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_getChatHistory_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Query_getChatHistory_argsUserID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["userId"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_getChatHistory_argsUserID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["userId"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("userId"))
|
|
if tmp, ok := rawArgs["userId"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_post_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Query_post_argsID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["id"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_post_argsID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["id"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field_Query_user_argsID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["id"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_user_argsID(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (string, error) {
|
|
if _, ok := rawArgs["id"]; !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field___Directive_args_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Directive_args_argsIncludeDeprecated(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (*bool, error) {
|
|
if _, ok := rawArgs["includeDeprecated"]; !ok {
|
|
var zeroVal *bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2ᚖbool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field___Field_args_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Field_args_argsIncludeDeprecated(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (*bool, error) {
|
|
if _, ok := rawArgs["includeDeprecated"]; !ok {
|
|
var zeroVal *bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2ᚖbool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (bool, error) {
|
|
if _, ok := rawArgs["includeDeprecated"]; !ok {
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
|
var err error
|
|
args := map[string]any{}
|
|
arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Type_fields_argsIncludeDeprecated(
|
|
ctx context.Context,
|
|
rawArgs map[string]any,
|
|
) (bool, error) {
|
|
if _, ok := rawArgs["includeDeprecated"]; !ok {
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
// endregion ***************************** args.gotpl *****************************
|
|
|
|
// region ************************** directives.gotpl **************************
|
|
|
|
// endregion ************************** directives.gotpl **************************
|
|
|
|
// region **************************** field.gotpl *****************************
|
|
|
|
func (ec *executionContext) _ChatSession_user(ctx context.Context, field graphql.CollectedField, obj *domain.ChatSession) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ChatSession_user(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.ChatSession().User(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ChatSession_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ChatSession",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ChatSession_lastMessage(ctx context.Context, field graphql.CollectedField, obj *domain.ChatSession) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ChatSession_lastMessage(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.ChatSession().LastMessage(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Message)
|
|
fc.Result = res
|
|
return ec.marshalNMessage2ᚖtailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ChatSession_lastMessage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ChatSession",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Message_id(ctx, field)
|
|
case "sender":
|
|
return ec.fieldContext_Message_sender(ctx, field)
|
|
case "receiver":
|
|
return ec.fieldContext_Message_receiver(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Message_content(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Message_createdAt(ctx, field)
|
|
case "status":
|
|
return ec.fieldContext_Message_status(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Message", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ChatSession_unreadCount(ctx context.Context, field graphql.CollectedField, obj *domain.ChatSession) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ChatSession_unreadCount(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.ChatSession().UnreadCount(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ChatSession_unreadCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ChatSession",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Int does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_id(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_id(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_content(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_content(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Content, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_content(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_post(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_post(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Comment().Post(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Post)
|
|
fc.Result = res
|
|
return ec.marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_post(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Post_content(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Post_author(ctx, field)
|
|
case "comments":
|
|
return ec.fieldContext_Post_comments(ctx, field)
|
|
case "likes":
|
|
return ec.fieldContext_Post_likes(ctx, field)
|
|
case "likesCount":
|
|
return ec.fieldContext_Post_likesCount(ctx, field)
|
|
case "isLiked":
|
|
return ec.fieldContext_Post_isLiked(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_author(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_author(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Comment().Author(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_author(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_createdAt(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_createdAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Comment().CreatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Comment_updatedAt(ctx context.Context, field graphql.CollectedField, obj *domain.Comment) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Comment_updatedAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Comment().UpdatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Comment_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Comment",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Like_id(ctx context.Context, field graphql.CollectedField, obj *domain.Like) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Like_id(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Like_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Like",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Like_post(ctx context.Context, field graphql.CollectedField, obj *domain.Like) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Like_post(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Like().Post(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Post)
|
|
fc.Result = res
|
|
return ec.marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Like_post(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Like",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Post_content(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Post_author(ctx, field)
|
|
case "comments":
|
|
return ec.fieldContext_Post_comments(ctx, field)
|
|
case "likes":
|
|
return ec.fieldContext_Post_likes(ctx, field)
|
|
case "likesCount":
|
|
return ec.fieldContext_Post_likesCount(ctx, field)
|
|
case "isLiked":
|
|
return ec.fieldContext_Post_isLiked(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Like_user(ctx context.Context, field graphql.CollectedField, obj *domain.Like) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Like_user(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Like().User(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Like_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Like",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Like_createdAt(ctx context.Context, field graphql.CollectedField, obj *domain.Like) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Like_createdAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Like().CreatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Like_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Like",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_id(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_sender(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_sender(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Message().Sender(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_sender(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_receiver(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_receiver(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Message().Receiver(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_receiver(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_content(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_content(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Content, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_content(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_createdAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Message().CreatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Message_status(ctx context.Context, field graphql.CollectedField, obj *domain.Message) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Message_status(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Status, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Message_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Message",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_register(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_register(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().Register(rctx, fc.Args["input"].(domain.RegisterInput))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_register(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_register_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_login(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_login(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().Login(rctx, fc.Args["input"].(domain.LoginInput))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Tokens)
|
|
fc.Result = res
|
|
return ec.marshalNTokens2ᚖtailly_back_v2ᚋinternalᚋdomainᚐTokens(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_login(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "accessToken":
|
|
return ec.fieldContext_Tokens_accessToken(ctx, field)
|
|
case "refreshToken":
|
|
return ec.fieldContext_Tokens_refreshToken(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Tokens", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_login_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_refreshTokens(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_refreshTokens(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().RefreshTokens(rctx, fc.Args["refreshToken"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Tokens)
|
|
fc.Result = res
|
|
return ec.marshalNTokens2ᚖtailly_back_v2ᚋinternalᚋdomainᚐTokens(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_refreshTokens(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "accessToken":
|
|
return ec.fieldContext_Tokens_accessToken(ctx, field)
|
|
case "refreshToken":
|
|
return ec.fieldContext_Tokens_refreshToken(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Tokens", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_refreshTokens_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_createPost(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_createPost(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreatePost(rctx, fc.Args["title"].(string), fc.Args["content"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Post)
|
|
fc.Result = res
|
|
return ec.marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_createPost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Post_content(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Post_author(ctx, field)
|
|
case "comments":
|
|
return ec.fieldContext_Post_comments(ctx, field)
|
|
case "likes":
|
|
return ec.fieldContext_Post_likes(ctx, field)
|
|
case "likesCount":
|
|
return ec.fieldContext_Post_likesCount(ctx, field)
|
|
case "isLiked":
|
|
return ec.fieldContext_Post_isLiked(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_createPost_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_createComment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_createComment(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreateComment(rctx, fc.Args["postId"].(string), fc.Args["content"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Comment)
|
|
fc.Result = res
|
|
return ec.marshalNComment2ᚖtailly_back_v2ᚋinternalᚋdomainᚐComment(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_createComment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Comment_id(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Comment_content(ctx, field)
|
|
case "post":
|
|
return ec.fieldContext_Comment_post(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Comment_author(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Comment_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Comment_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Comment", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_createComment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_likePost(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_likePost(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().LikePost(rctx, fc.Args["postId"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Like)
|
|
fc.Result = res
|
|
return ec.marshalNLike2ᚖtailly_back_v2ᚋinternalᚋdomainᚐLike(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_likePost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Like_id(ctx, field)
|
|
case "post":
|
|
return ec.fieldContext_Like_post(ctx, field)
|
|
case "user":
|
|
return ec.fieldContext_Like_user(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Like_createdAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Like", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_likePost_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_unlikePost(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_unlikePost(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UnlikePost(rctx, fc.Args["postId"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_unlikePost(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_unlikePost_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateProfile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_updateProfile(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateProfile(rctx, fc.Args["username"].(string), fc.Args["email"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_updateProfile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_updateProfile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_changePassword(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_changePassword(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().ChangePassword(rctx, fc.Args["oldPassword"].(string), fc.Args["newPassword"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_changePassword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_changePassword_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_sendMessage(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_sendMessage(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().SendMessage(rctx, fc.Args["receiverId"].(string), fc.Args["content"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Message)
|
|
fc.Result = res
|
|
return ec.marshalNMessage2ᚖtailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_sendMessage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Message_id(ctx, field)
|
|
case "sender":
|
|
return ec.fieldContext_Message_sender(ctx, field)
|
|
case "receiver":
|
|
return ec.fieldContext_Message_receiver(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Message_content(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Message_createdAt(ctx, field)
|
|
case "status":
|
|
return ec.fieldContext_Message_status(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Message", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_sendMessage_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_markAsRead(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_markAsRead(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().MarkAsRead(rctx, fc.Args["messageId"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_markAsRead(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Mutation_markAsRead_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_id(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_id(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_title(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_title(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Title, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_content(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_content(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Content, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_content(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_author(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_author(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().Author(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_author(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_comments(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_comments(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().Comments(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*domain.Comment)
|
|
fc.Result = res
|
|
return ec.marshalNComment2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐCommentᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_comments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Comment_id(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Comment_content(ctx, field)
|
|
case "post":
|
|
return ec.fieldContext_Comment_post(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Comment_author(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Comment_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Comment_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Comment", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_likes(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_likes(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().Likes(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*domain.Like)
|
|
fc.Result = res
|
|
return ec.marshalNLike2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐLikeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_likes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Like_id(ctx, field)
|
|
case "post":
|
|
return ec.fieldContext_Like_post(ctx, field)
|
|
case "user":
|
|
return ec.fieldContext_Like_user(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Like_createdAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Like", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_likesCount(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_likesCount(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().LikesCount(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_likesCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Int does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_isLiked(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_isLiked(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().IsLiked(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_isLiked(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_createdAt(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_createdAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().CreatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_updatedAt(ctx context.Context, field graphql.CollectedField, obj *domain.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_updatedAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Post().UpdatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_me(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Me(rctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_me(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_post(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_post(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Post(rctx, fc.Args["id"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.Post)
|
|
fc.Result = res
|
|
return ec.marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_post(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Post_content(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Post_author(ctx, field)
|
|
case "comments":
|
|
return ec.fieldContext_Post_comments(ctx, field)
|
|
case "likes":
|
|
return ec.fieldContext_Post_likes(ctx, field)
|
|
case "likesCount":
|
|
return ec.fieldContext_Post_likesCount(ctx, field)
|
|
case "isLiked":
|
|
return ec.fieldContext_Post_isLiked(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Query_post_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_posts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_posts(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Posts(rctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*domain.Post)
|
|
fc.Result = res
|
|
return ec.marshalNPost2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐPostᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_posts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Post_content(ctx, field)
|
|
case "author":
|
|
return ec.fieldContext_Post_author(ctx, field)
|
|
case "comments":
|
|
return ec.fieldContext_Post_comments(ctx, field)
|
|
case "likes":
|
|
return ec.fieldContext_Post_likes(ctx, field)
|
|
case "likesCount":
|
|
return ec.fieldContext_Post_likesCount(ctx, field)
|
|
case "isLiked":
|
|
return ec.fieldContext_Post_isLiked(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_user(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().User(rctx, fc.Args["id"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*domain.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_User_id(ctx, field)
|
|
case "username":
|
|
return ec.fieldContext_User_username(ctx, field)
|
|
case "email":
|
|
return ec.fieldContext_User_email(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_User_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_User_updatedAt(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type User", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Query_user_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_getChatHistory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_getChatHistory(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().GetChatHistory(rctx, fc.Args["userId"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*domain.Message)
|
|
fc.Result = res
|
|
return ec.marshalNMessage2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐMessageᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_getChatHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Message_id(ctx, field)
|
|
case "sender":
|
|
return ec.fieldContext_Message_sender(ctx, field)
|
|
case "receiver":
|
|
return ec.fieldContext_Message_receiver(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Message_content(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Message_createdAt(ctx, field)
|
|
case "status":
|
|
return ec.fieldContext_Message_status(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Message", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Query_getChatHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_getUserChats(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_getUserChats(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().GetUserChats(rctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*domain.ChatSession)
|
|
fc.Result = res
|
|
return ec.marshalNChatSession2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐChatSessionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_getUserChats(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "user":
|
|
return ec.fieldContext_ChatSession_user(ctx, field)
|
|
case "lastMessage":
|
|
return ec.fieldContext_ChatSession_lastMessage(ctx, field)
|
|
case "unreadCount":
|
|
return ec.fieldContext_ChatSession_unreadCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type ChatSession", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query___type(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.introspectType(fc.Args["name"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query___schema(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.introspectSchema()
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Schema)
|
|
fc.Result = res
|
|
return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "description":
|
|
return ec.fieldContext___Schema_description(ctx, field)
|
|
case "types":
|
|
return ec.fieldContext___Schema_types(ctx, field)
|
|
case "queryType":
|
|
return ec.fieldContext___Schema_queryType(ctx, field)
|
|
case "mutationType":
|
|
return ec.fieldContext___Schema_mutationType(ctx, field)
|
|
case "subscriptionType":
|
|
return ec.fieldContext___Schema_subscriptionType(ctx, field)
|
|
case "directives":
|
|
return ec.fieldContext___Schema_directives(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Subscription_messageReceived(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Subscription_messageReceived(ctx, field)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Subscription().MessageReceived(rctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return nil
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return nil
|
|
}
|
|
return func(ctx context.Context) graphql.Marshaler {
|
|
select {
|
|
case res, ok := <-resTmp.(<-chan *domain.Message):
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return graphql.WriterFunc(func(w io.Writer) {
|
|
w.Write([]byte{'{'})
|
|
graphql.MarshalString(field.Alias).MarshalGQL(w)
|
|
w.Write([]byte{':'})
|
|
ec.marshalNMessage2ᚖtailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx, field.Selections, res).MarshalGQL(w)
|
|
w.Write([]byte{'}'})
|
|
})
|
|
case <-ctx.Done():
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Subscription_messageReceived(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Subscription",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Message_id(ctx, field)
|
|
case "sender":
|
|
return ec.fieldContext_Message_sender(ctx, field)
|
|
case "receiver":
|
|
return ec.fieldContext_Message_receiver(ctx, field)
|
|
case "content":
|
|
return ec.fieldContext_Message_content(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Message_createdAt(ctx, field)
|
|
case "status":
|
|
return ec.fieldContext_Message_status(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Message", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Tokens_accessToken(ctx context.Context, field graphql.CollectedField, obj *domain.Tokens) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Tokens_accessToken(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AccessToken, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Tokens_accessToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Tokens",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Tokens_refreshToken(ctx context.Context, field graphql.CollectedField, obj *domain.Tokens) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Tokens_refreshToken(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.RefreshToken, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Tokens_refreshToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Tokens",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *domain.User) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_User_id(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *domain.User) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_User_username(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Username, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _User_email(ctx context.Context, field graphql.CollectedField, obj *domain.User) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_User_email(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Email, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_User_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _User_createdAt(ctx context.Context, field graphql.CollectedField, obj *domain.User) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_User_createdAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.User().CreatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_User_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _User_updatedAt(ctx context.Context, field graphql.CollectedField, obj *domain.User) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_User_updatedAt(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.User().UpdatedAt(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_User_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_name(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsRepeatable, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_locations(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Locations, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]string)
|
|
fc.Result = res
|
|
return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type __DirectiveLocation does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_args(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Args, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_name(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsDeprecated(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_name(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_args(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Args, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_type(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Type, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_isDeprecated(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsDeprecated(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_deprecationReason(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_name(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_type(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Type, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DefaultValue, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_isDeprecated(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsDeprecated(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_deprecationReason(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_types(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Types(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_queryType(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.QueryType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_mutationType(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.MutationType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.SubscriptionType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_directives(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Directives(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Directive)
|
|
fc.Result = res
|
|
return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___Directive_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Directive_description(ctx, field)
|
|
case "isRepeatable":
|
|
return ec.fieldContext___Directive_isRepeatable(ctx, field)
|
|
case "locations":
|
|
return ec.fieldContext___Directive_locations(ctx, field)
|
|
case "args":
|
|
return ec.fieldContext___Directive_args(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_kind(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Kind(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalN__TypeKind2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type __TypeKind does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_name(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_description(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.SpecifiedByURL(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type String does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_fields(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Field)
|
|
fc.Result = res
|
|
return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___Field_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Field_description(ctx, field)
|
|
case "args":
|
|
return ec.fieldContext___Field_args(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___Field_type(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___Field_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___Field_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_interfaces(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Interfaces(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.PossibleTypes(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_enumValues(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.EnumValue)
|
|
fc.Result = res
|
|
return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___EnumValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___EnumValue_description(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___EnumValue_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___EnumValue_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name)
|
|
},
|
|
}
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
err = ec.Recover(ctx, r)
|
|
ec.Error(ctx, err)
|
|
}
|
|
}()
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_inputFields(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.InputFields(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_ofType(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.OfType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "isOneOf":
|
|
return ec.fieldContext___Type_isOneOf(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_isOneOf(ctx, field)
|
|
if err != nil {
|
|
return graphql.Null
|
|
}
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsOneOf(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalOBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
// endregion **************************** field.gotpl *****************************
|
|
|
|
// region **************************** input.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj any) (domain.LoginInput, error) {
|
|
var it domain.LoginInput
|
|
asMap := map[string]any{}
|
|
for k, v := range obj.(map[string]any) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"email", "password"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "email":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Email = data
|
|
case "password":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Password = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputRegisterInput(ctx context.Context, obj any) (domain.RegisterInput, error) {
|
|
var it domain.RegisterInput
|
|
asMap := map[string]any{}
|
|
for k, v := range obj.(map[string]any) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"username", "email", "password"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "username":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Username = data
|
|
case "email":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Email = data
|
|
case "password":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Password = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
// endregion **************************** input.gotpl *****************************
|
|
|
|
// region ************************** interface.gotpl ***************************
|
|
|
|
// endregion ************************** interface.gotpl ***************************
|
|
|
|
// region **************************** object.gotpl ****************************
|
|
|
|
var chatSessionImplementors = []string{"ChatSession"}
|
|
|
|
func (ec *executionContext) _ChatSession(ctx context.Context, sel ast.SelectionSet, obj *domain.ChatSession) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, chatSessionImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("ChatSession")
|
|
case "user":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._ChatSession_user(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "lastMessage":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._ChatSession_lastMessage(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "unreadCount":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._ChatSession_unreadCount(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var commentImplementors = []string{"Comment"}
|
|
|
|
func (ec *executionContext) _Comment(ctx context.Context, sel ast.SelectionSet, obj *domain.Comment) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, commentImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Comment")
|
|
case "id":
|
|
out.Values[i] = ec._Comment_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "content":
|
|
out.Values[i] = ec._Comment_content(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "post":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Comment_post(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "author":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Comment_author(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "createdAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Comment_createdAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "updatedAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Comment_updatedAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var likeImplementors = []string{"Like"}
|
|
|
|
func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj *domain.Like) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, likeImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Like")
|
|
case "id":
|
|
out.Values[i] = ec._Like_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "post":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Like_post(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "user":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Like_user(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "createdAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Like_createdAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var messageImplementors = []string{"Message"}
|
|
|
|
func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *domain.Message) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, messageImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Message")
|
|
case "id":
|
|
out.Values[i] = ec._Message_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "sender":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Message_sender(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "receiver":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Message_receiver(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "content":
|
|
out.Values[i] = ec._Message_content(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "createdAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Message_createdAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "status":
|
|
out.Values[i] = ec._Message_status(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var mutationImplementors = []string{"Mutation"}
|
|
|
|
func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
|
|
Object: field.Name,
|
|
Field: field,
|
|
})
|
|
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Mutation")
|
|
case "register":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_register(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "login":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_login(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "refreshTokens":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_refreshTokens(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "createPost":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_createPost(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "createComment":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_createComment(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "likePost":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_likePost(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "unlikePost":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_unlikePost(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "updateProfile":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_updateProfile(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "changePassword":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_changePassword(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "sendMessage":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_sendMessage(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "markAsRead":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_markAsRead(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var postImplementors = []string{"Post"}
|
|
|
|
func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj *domain.Post) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, postImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Post")
|
|
case "id":
|
|
out.Values[i] = ec._Post_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "title":
|
|
out.Values[i] = ec._Post_title(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "content":
|
|
out.Values[i] = ec._Post_content(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "author":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_author(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "comments":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_comments(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "likes":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_likes(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "likesCount":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_likesCount(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "isLiked":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_isLiked(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "createdAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_createdAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "updatedAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_updatedAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var queryImplementors = []string{"Query"}
|
|
|
|
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Query",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
|
|
Object: field.Name,
|
|
Field: field,
|
|
})
|
|
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Query")
|
|
case "me":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_me(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "post":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_post(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "posts":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_posts(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "user":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_user(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "getChatHistory":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_getChatHistory(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "getUserChats":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_getUserChats(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
rrm := func(ctx context.Context) graphql.Marshaler {
|
|
return ec.OperationContext.RootResolverMiddleware(ctx,
|
|
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
|
|
case "__type":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Query___type(ctx, field)
|
|
})
|
|
case "__schema":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Query___schema(ctx, field)
|
|
})
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var subscriptionImplementors = []string{"Subscription"}
|
|
|
|
func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Subscription",
|
|
})
|
|
if len(fields) != 1 {
|
|
ec.Errorf(ctx, "must subscribe to exactly one stream")
|
|
return nil
|
|
}
|
|
|
|
switch fields[0].Name {
|
|
case "messageReceived":
|
|
return ec._Subscription_messageReceived(ctx, fields[0])
|
|
default:
|
|
panic("unknown field " + strconv.Quote(fields[0].Name))
|
|
}
|
|
}
|
|
|
|
var tokensImplementors = []string{"Tokens"}
|
|
|
|
func (ec *executionContext) _Tokens(ctx context.Context, sel ast.SelectionSet, obj *domain.Tokens) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, tokensImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Tokens")
|
|
case "accessToken":
|
|
out.Values[i] = ec._Tokens_accessToken(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "refreshToken":
|
|
out.Values[i] = ec._Tokens_refreshToken(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var userImplementors = []string{"User"}
|
|
|
|
func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *domain.User) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("User")
|
|
case "id":
|
|
out.Values[i] = ec._User_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "username":
|
|
out.Values[i] = ec._User_username(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "email":
|
|
out.Values[i] = ec._User_email(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "createdAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._User_createdAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
case "updatedAt":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._User_updatedAt(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&fs.Invalids, 1)
|
|
}
|
|
return res
|
|
}
|
|
|
|
if field.Deferrable != nil {
|
|
dfs, ok := deferred[field.Deferrable.Label]
|
|
di := 0
|
|
if ok {
|
|
dfs.AddField(field)
|
|
di = len(dfs.Values) - 1
|
|
} else {
|
|
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
|
|
deferred[field.Deferrable.Label] = dfs
|
|
}
|
|
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
|
|
return innerFunc(ctx, dfs)
|
|
})
|
|
|
|
// don't run the out.Concurrently() call below
|
|
out.Values[i] = graphql.Null
|
|
continue
|
|
}
|
|
|
|
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __DirectiveImplementors = []string{"__Directive"}
|
|
|
|
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Directive")
|
|
case "name":
|
|
out.Values[i] = ec.___Directive_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Directive_description(ctx, field, obj)
|
|
case "isRepeatable":
|
|
out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "locations":
|
|
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "args":
|
|
out.Values[i] = ec.___Directive_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __EnumValueImplementors = []string{"__EnumValue"}
|
|
|
|
func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__EnumValue")
|
|
case "name":
|
|
out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __FieldImplementors = []string{"__Field"}
|
|
|
|
func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Field")
|
|
case "name":
|
|
out.Values[i] = ec.___Field_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Field_description(ctx, field, obj)
|
|
case "args":
|
|
out.Values[i] = ec.___Field_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "type":
|
|
out.Values[i] = ec.___Field_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __InputValueImplementors = []string{"__InputValue"}
|
|
|
|
func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__InputValue")
|
|
case "name":
|
|
out.Values[i] = ec.___InputValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___InputValue_description(ctx, field, obj)
|
|
case "type":
|
|
out.Values[i] = ec.___InputValue_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "defaultValue":
|
|
out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __SchemaImplementors = []string{"__Schema"}
|
|
|
|
func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Schema")
|
|
case "description":
|
|
out.Values[i] = ec.___Schema_description(ctx, field, obj)
|
|
case "types":
|
|
out.Values[i] = ec.___Schema_types(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "queryType":
|
|
out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "mutationType":
|
|
out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
|
|
case "subscriptionType":
|
|
out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
|
|
case "directives":
|
|
out.Values[i] = ec.___Schema_directives(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
var __TypeImplementors = []string{"__Type"}
|
|
|
|
func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Type")
|
|
case "kind":
|
|
out.Values[i] = ec.___Type_kind(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "name":
|
|
out.Values[i] = ec.___Type_name(ctx, field, obj)
|
|
case "description":
|
|
out.Values[i] = ec.___Type_description(ctx, field, obj)
|
|
case "specifiedByURL":
|
|
out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj)
|
|
case "fields":
|
|
out.Values[i] = ec.___Type_fields(ctx, field, obj)
|
|
case "interfaces":
|
|
out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
|
|
case "possibleTypes":
|
|
out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
|
|
case "enumValues":
|
|
out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
|
|
case "inputFields":
|
|
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
|
|
case "ofType":
|
|
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
|
|
case "isOneOf":
|
|
out.Values[i] = ec.___Type_isOneOf(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch(ctx)
|
|
if out.Invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
|
|
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
|
|
|
|
for label, dfs := range deferred {
|
|
ec.processDeferredGroup(graphql.DeferredGroup{
|
|
Label: label,
|
|
Path: graphql.GetPath(ctx),
|
|
FieldSet: dfs,
|
|
Context: ctx,
|
|
})
|
|
}
|
|
|
|
return out
|
|
}
|
|
|
|
// endregion **************************** object.gotpl ****************************
|
|
|
|
// region ***************************** type.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
res := graphql.MarshalBoolean(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalNChatSession2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐChatSessionᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.ChatSession) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNChatSession2ᚖtailly_back_v2ᚋinternalᚋdomainᚐChatSession(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNChatSession2ᚖtailly_back_v2ᚋinternalᚋdomainᚐChatSession(ctx context.Context, sel ast.SelectionSet, v *domain.ChatSession) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._ChatSession(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNComment2tailly_back_v2ᚋinternalᚋdomainᚐComment(ctx context.Context, sel ast.SelectionSet, v domain.Comment) graphql.Marshaler {
|
|
return ec._Comment(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNComment2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐCommentᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.Comment) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNComment2ᚖtailly_back_v2ᚋinternalᚋdomainᚐComment(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNComment2ᚖtailly_back_v2ᚋinternalᚋdomainᚐComment(ctx context.Context, sel ast.SelectionSet, v *domain.Comment) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Comment(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNID2int(ctx context.Context, v any) (int, error) {
|
|
res, err := graphql.UnmarshalIntID(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
|
|
res := graphql.MarshalIntID(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) {
|
|
res, err := graphql.UnmarshalID(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalID(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v any) (int, error) {
|
|
res, err := graphql.UnmarshalInt(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
|
|
res := graphql.MarshalInt(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalNLike2tailly_back_v2ᚋinternalᚋdomainᚐLike(ctx context.Context, sel ast.SelectionSet, v domain.Like) graphql.Marshaler {
|
|
return ec._Like(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNLike2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐLikeᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.Like) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNLike2ᚖtailly_back_v2ᚋinternalᚋdomainᚐLike(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNLike2ᚖtailly_back_v2ᚋinternalᚋdomainᚐLike(ctx context.Context, sel ast.SelectionSet, v *domain.Like) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Like(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNLoginInput2tailly_back_v2ᚋinternalᚋdomainᚐLoginInput(ctx context.Context, v any) (domain.LoginInput, error) {
|
|
res, err := ec.unmarshalInputLoginInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNMessage2tailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx context.Context, sel ast.SelectionSet, v domain.Message) graphql.Marshaler {
|
|
return ec._Message(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNMessage2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐMessageᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.Message) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNMessage2ᚖtailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNMessage2ᚖtailly_back_v2ᚋinternalᚋdomainᚐMessage(ctx context.Context, sel ast.SelectionSet, v *domain.Message) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Message(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPost2tailly_back_v2ᚋinternalᚋdomainᚐPost(ctx context.Context, sel ast.SelectionSet, v domain.Post) graphql.Marshaler {
|
|
return ec._Post(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPost2ᚕᚖtailly_back_v2ᚋinternalᚋdomainᚐPostᚄ(ctx context.Context, sel ast.SelectionSet, v []*domain.Post) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPost2ᚖtailly_back_v2ᚋinternalᚋdomainᚐPost(ctx context.Context, sel ast.SelectionSet, v *domain.Post) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Post(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNRegisterInput2tailly_back_v2ᚋinternalᚋdomainᚐRegisterInput(ctx context.Context, v any) (domain.RegisterInput, error) {
|
|
res, err := ec.unmarshalInputRegisterInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalNTokens2tailly_back_v2ᚋinternalᚋdomainᚐTokens(ctx context.Context, sel ast.SelectionSet, v domain.Tokens) graphql.Marshaler {
|
|
return ec._Tokens(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNTokens2ᚖtailly_back_v2ᚋinternalᚋdomainᚐTokens(ctx context.Context, sel ast.SelectionSet, v *domain.Tokens) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Tokens(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUser2tailly_back_v2ᚋinternalᚋdomainᚐUser(ctx context.Context, sel ast.SelectionSet, v domain.User) graphql.Marshaler {
|
|
return ec._User(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUser2ᚖtailly_back_v2ᚋinternalᚋdomainᚐUser(ctx context.Context, sel ast.SelectionSet, v *domain.User) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._User(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
|
|
return ec.___Directive(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) {
|
|
var vSlice []any
|
|
vSlice = graphql.CoerceList(v)
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
|
|
return ec.___EnumValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
|
|
return ec.___Field(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
|
|
return ec.___InputValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
|
|
return ec.___Type(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec.___Type(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
res := graphql.MarshalBoolean(v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalBoolean(*v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalString(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalString(*v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Schema(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Type(ctx, sel, v)
|
|
}
|
|
|
|
// endregion ***************************** type.gotpl *****************************
|