6750 lines
208 KiB
Go
6750 lines
208 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package generated
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"strconv"
|
|
"sync"
|
|
"sync/atomic"
|
|
"time"
|
|
|
|
"code.icod.de/dalu/ka/ent"
|
|
"entgo.io/contrib/entgql"
|
|
"github.com/99designs/gqlgen/graphql"
|
|
"github.com/99designs/gqlgen/graphql/introspection"
|
|
"github.com/google/uuid"
|
|
"github.com/vektah/gqlparser/v2/ast"
|
|
)
|
|
|
|
// region ************************** generated!.gotpl **************************
|
|
|
|
type QueryResolver interface {
|
|
Node(ctx context.Context, id uuid.UUID) (ent.Noder, error)
|
|
Nodes(ctx context.Context, ids []uuid.UUID) ([]ent.Noder, error)
|
|
Categories(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *ent.CategoryOrder, where *ent.CategoryWhereInput) (*ent.CategoryConnection, error)
|
|
Posts(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *ent.PostOrder, where *ent.PostWhereInput) (*ent.PostConnection, error)
|
|
Profiles(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *ent.ProfileOrder, where *ent.ProfileWhereInput) (*ent.ProfileConnection, error)
|
|
}
|
|
|
|
// endregion ************************** generated!.gotpl **************************
|
|
|
|
// region ***************************** args.gotpl *****************************
|
|
|
|
func (ec *executionContext) field_Category_posts_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Category_posts_argsAfter(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["after"] = arg0
|
|
arg1, err := ec.field_Category_posts_argsFirst(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["first"] = arg1
|
|
arg2, err := ec.field_Category_posts_argsBefore(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["before"] = arg2
|
|
arg3, err := ec.field_Category_posts_argsLast(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["last"] = arg3
|
|
arg4, err := ec.field_Category_posts_argsOrderBy(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["orderBy"] = arg4
|
|
arg5, err := ec.field_Category_posts_argsWhere(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["where"] = arg5
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Category_posts_argsAfter(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["after"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
|
if tmp, ok := rawArgs["after"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Category_posts_argsFirst(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["first"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
|
if tmp, ok := rawArgs["first"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Category_posts_argsBefore(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["before"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
|
if tmp, ok := rawArgs["before"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Category_posts_argsLast(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["last"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
|
if tmp, ok := rawArgs["last"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Category_posts_argsOrderBy(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostOrder, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["orderBy"]
|
|
if !ok {
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
|
if tmp, ok := rawArgs["orderBy"]; ok {
|
|
return ec.unmarshalOPostOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrder(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Category_posts_argsWhere(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostWhereInput, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["where"]
|
|
if !ok {
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where"))
|
|
if tmp, ok := rawArgs["where"]; ok {
|
|
return ec.unmarshalOPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Profile_posts_argsAfter(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["after"] = arg0
|
|
arg1, err := ec.field_Profile_posts_argsFirst(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["first"] = arg1
|
|
arg2, err := ec.field_Profile_posts_argsBefore(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["before"] = arg2
|
|
arg3, err := ec.field_Profile_posts_argsLast(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["last"] = arg3
|
|
arg4, err := ec.field_Profile_posts_argsOrderBy(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["orderBy"] = arg4
|
|
arg5, err := ec.field_Profile_posts_argsWhere(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["where"] = arg5
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Profile_posts_argsAfter(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["after"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
|
if tmp, ok := rawArgs["after"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_argsFirst(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["first"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
|
if tmp, ok := rawArgs["first"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_argsBefore(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["before"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
|
if tmp, ok := rawArgs["before"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_argsLast(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["last"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
|
if tmp, ok := rawArgs["last"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_argsOrderBy(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostOrder, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["orderBy"]
|
|
if !ok {
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
|
if tmp, ok := rawArgs["orderBy"]; ok {
|
|
return ec.unmarshalOPostOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrder(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Profile_posts_argsWhere(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostWhereInput, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["where"]
|
|
if !ok {
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where"))
|
|
if tmp, ok := rawArgs["where"]; ok {
|
|
return ec.unmarshalOPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
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]interface{},
|
|
) (string, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["name"]
|
|
if !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_categories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_categories_argsAfter(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["after"] = arg0
|
|
arg1, err := ec.field_Query_categories_argsFirst(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["first"] = arg1
|
|
arg2, err := ec.field_Query_categories_argsBefore(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["before"] = arg2
|
|
arg3, err := ec.field_Query_categories_argsLast(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["last"] = arg3
|
|
arg4, err := ec.field_Query_categories_argsOrderBy(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["orderBy"] = arg4
|
|
arg5, err := ec.field_Query_categories_argsWhere(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["where"] = arg5
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_categories_argsAfter(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["after"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
|
if tmp, ok := rawArgs["after"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_categories_argsFirst(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["first"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
|
if tmp, ok := rawArgs["first"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_categories_argsBefore(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["before"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
|
if tmp, ok := rawArgs["before"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_categories_argsLast(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["last"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
|
if tmp, ok := rawArgs["last"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_categories_argsOrderBy(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.CategoryOrder, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["orderBy"]
|
|
if !ok {
|
|
var zeroVal *ent.CategoryOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
|
if tmp, ok := rawArgs["orderBy"]; ok {
|
|
return ec.unmarshalOCategoryOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryOrder(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.CategoryOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_categories_argsWhere(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.CategoryWhereInput, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["where"]
|
|
if !ok {
|
|
var zeroVal *ent.CategoryWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where"))
|
|
if tmp, ok := rawArgs["where"]; ok {
|
|
return ec.unmarshalOCategoryWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.CategoryWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_node_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_node_argsID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["id"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_node_argsID(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (uuid.UUID, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["id"]
|
|
if !ok {
|
|
var zeroVal uuid.UUID
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
return ec.unmarshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal uuid.UUID
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_nodes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_nodes_argsIds(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["ids"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_nodes_argsIds(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) ([]uuid.UUID, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["ids"]
|
|
if !ok {
|
|
var zeroVal []uuid.UUID
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
return ec.unmarshalNID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal []uuid.UUID
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_posts_argsAfter(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["after"] = arg0
|
|
arg1, err := ec.field_Query_posts_argsFirst(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["first"] = arg1
|
|
arg2, err := ec.field_Query_posts_argsBefore(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["before"] = arg2
|
|
arg3, err := ec.field_Query_posts_argsLast(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["last"] = arg3
|
|
arg4, err := ec.field_Query_posts_argsOrderBy(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["orderBy"] = arg4
|
|
arg5, err := ec.field_Query_posts_argsWhere(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["where"] = arg5
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_posts_argsAfter(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["after"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
|
if tmp, ok := rawArgs["after"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_argsFirst(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["first"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
|
if tmp, ok := rawArgs["first"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_argsBefore(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["before"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
|
if tmp, ok := rawArgs["before"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_argsLast(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["last"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
|
if tmp, ok := rawArgs["last"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_argsOrderBy(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostOrder, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["orderBy"]
|
|
if !ok {
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
|
if tmp, ok := rawArgs["orderBy"]; ok {
|
|
return ec.unmarshalOPostOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrder(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_posts_argsWhere(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.PostWhereInput, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["where"]
|
|
if !ok {
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where"))
|
|
if tmp, ok := rawArgs["where"]; ok {
|
|
return ec.unmarshalOPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.PostWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_profiles_argsAfter(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["after"] = arg0
|
|
arg1, err := ec.field_Query_profiles_argsFirst(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["first"] = arg1
|
|
arg2, err := ec.field_Query_profiles_argsBefore(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["before"] = arg2
|
|
arg3, err := ec.field_Query_profiles_argsLast(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["last"] = arg3
|
|
arg4, err := ec.field_Query_profiles_argsOrderBy(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["orderBy"] = arg4
|
|
arg5, err := ec.field_Query_profiles_argsWhere(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["where"] = arg5
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_profiles_argsAfter(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["after"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after"))
|
|
if tmp, ok := rawArgs["after"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_argsFirst(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["first"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first"))
|
|
if tmp, ok := rawArgs["first"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_argsBefore(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*entgql.Cursor[uuid.UUID], error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["before"]
|
|
if !ok {
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("before"))
|
|
if tmp, ok := rawArgs["before"]; ok {
|
|
return ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *entgql.Cursor[uuid.UUID]
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_argsLast(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*int, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["last"]
|
|
if !ok {
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("last"))
|
|
if tmp, ok := rawArgs["last"]; ok {
|
|
return ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *int
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_argsOrderBy(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.ProfileOrder, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["orderBy"]
|
|
if !ok {
|
|
var zeroVal *ent.ProfileOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy"))
|
|
if tmp, ok := rawArgs["orderBy"]; ok {
|
|
return ec.unmarshalOProfileOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileOrder(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.ProfileOrder
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profiles_argsWhere(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (*ent.ProfileWhereInput, error) {
|
|
// We won't call the directive if the argument is null.
|
|
// Set call_argument_directives_with_null to true to call directives
|
|
// even if the argument is null.
|
|
_, ok := rawArgs["where"]
|
|
if !ok {
|
|
var zeroVal *ent.ProfileWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where"))
|
|
if tmp, ok := rawArgs["where"]; ok {
|
|
return ec.unmarshalOProfileWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInput(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal *ent.ProfileWhereInput
|
|
return zeroVal, nil
|
|
}
|
|
|
|
// endregion ***************************** args.gotpl *****************************
|
|
|
|
// region ************************** directives.gotpl **************************
|
|
|
|
// endregion ************************** directives.gotpl **************************
|
|
|
|
// region **************************** field.gotpl *****************************
|
|
|
|
func (ec *executionContext) _Category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, 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.(uuid.UUID)
|
|
fc.Result = res
|
|
return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
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) _Category_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, 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.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Category_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Category_updatedAt(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.UpdatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Category_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Category_title(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, 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_Category_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
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) _Category_description(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, 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.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Category_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
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) _Category_posts(ctx context.Context, field graphql.CollectedField, obj *ent.Category) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Category_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Posts(ctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.PostOrder), fc.Args["where"].(*ent.PostWhereInput))
|
|
})
|
|
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.(*ent.PostConnection)
|
|
fc.Result = res
|
|
return ec.marshalNPostConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostConnection(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Category_posts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Category",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "edges":
|
|
return ec.fieldContext_PostConnection_edges(ctx, field)
|
|
case "pageInfo":
|
|
return ec.fieldContext_PostConnection_pageInfo(ctx, field)
|
|
case "totalCount":
|
|
return ec.fieldContext_PostConnection_totalCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PostConnection", 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_Category_posts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _CategoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.CategoryConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_CategoryConnection_edges(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Edges, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*ent.CategoryEdge)
|
|
fc.Result = res
|
|
return ec.marshalOCategoryEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryEdge(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_CategoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "CategoryConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "node":
|
|
return ec.fieldContext_CategoryEdge_node(ctx, field)
|
|
case "cursor":
|
|
return ec.fieldContext_CategoryEdge_cursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type CategoryEdge", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _CategoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.CategoryConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_CategoryConnection_pageInfo(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.PageInfo, 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.(entgql.PageInfo[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_CategoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "CategoryConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "hasNextPage":
|
|
return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
|
|
case "hasPreviousPage":
|
|
return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
|
|
case "startCursor":
|
|
return ec.fieldContext_PageInfo_startCursor(ctx, field)
|
|
case "endCursor":
|
|
return ec.fieldContext_PageInfo_endCursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _CategoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.CategoryConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_CategoryConnection_totalCount(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.TotalCount, 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.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_CategoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "CategoryConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _CategoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.CategoryEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_CategoryEdge_node(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Node, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ent.Category)
|
|
fc.Result = res
|
|
return ec.marshalOCategory2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategory(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_CategoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "CategoryEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Category_id(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Category_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Category_updatedAt(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Category_title(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext_Category_description(ctx, field)
|
|
case "posts":
|
|
return ec.fieldContext_Category_posts(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Category", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _CategoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.CategoryEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_CategoryEdge_cursor(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Cursor, 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.(entgql.Cursor[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_CategoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "CategoryEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Cursor does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PageInfo_hasNextPage(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.HasNextPage, 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_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PageInfo",
|
|
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) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PageInfo_hasPreviousPage(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.HasPreviousPage, 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_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PageInfo",
|
|
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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PageInfo_startCursor(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.StartCursor, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*entgql.Cursor[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PageInfo",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Cursor does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PageInfo_endCursor(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.EndCursor, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*entgql.Cursor[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PageInfo",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Cursor does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_id(ctx context.Context, field graphql.CollectedField, obj *ent.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) (interface{}, 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.(uuid.UUID)
|
|
fc.Result = res
|
|
return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(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_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, 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.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(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: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_updatedAt(ctx context.Context, field graphql.CollectedField, obj *ent.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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.UpdatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalOTime2timeᚐTime(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: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_expires(ctx context.Context, field graphql.CollectedField, obj *ent.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_expires(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Expires, 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_Post_expires(_ 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 Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_expireTime(ctx context.Context, field graphql.CollectedField, obj *ent.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_expireTime(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ExpireTime, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*time.Time)
|
|
fc.Result = res
|
|
return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_expireTime(_ 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 Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_title(ctx context.Context, field graphql.CollectedField, obj *ent.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) (interface{}, 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_body(ctx context.Context, field graphql.CollectedField, obj *ent.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_body(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Body, 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_body(_ 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_category(ctx context.Context, field graphql.CollectedField, obj *ent.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_category(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Category(ctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ent.Category)
|
|
fc.Result = res
|
|
return ec.marshalOCategory2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategory(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Category_id(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Category_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Category_updatedAt(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Category_title(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext_Category_description(ctx, field)
|
|
case "posts":
|
|
return ec.fieldContext_Category_posts(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Category", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Post_profile(ctx context.Context, field graphql.CollectedField, obj *ent.Post) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Post_profile(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Profile(ctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ent.Profile)
|
|
fc.Result = res
|
|
return ec.marshalOProfile2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfile(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Post_profile(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Post",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Profile_id(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Profile_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Profile_updatedAt(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext_Profile_name(ctx, field)
|
|
case "address":
|
|
return ec.fieldContext_Profile_address(ctx, field)
|
|
case "phone":
|
|
return ec.fieldContext_Profile_phone(ctx, field)
|
|
case "posts":
|
|
return ec.fieldContext_Profile_posts(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PostConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.PostConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PostConnection_edges(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Edges, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*ent.PostEdge)
|
|
fc.Result = res
|
|
return ec.marshalOPostEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostEdge(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PostConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PostConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "node":
|
|
return ec.fieldContext_PostEdge_node(ctx, field)
|
|
case "cursor":
|
|
return ec.fieldContext_PostEdge_cursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PostEdge", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PostConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.PostConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PostConnection_pageInfo(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.PageInfo, 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.(entgql.PageInfo[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PostConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PostConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "hasNextPage":
|
|
return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
|
|
case "hasPreviousPage":
|
|
return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
|
|
case "startCursor":
|
|
return ec.fieldContext_PageInfo_startCursor(ctx, field)
|
|
case "endCursor":
|
|
return ec.fieldContext_PageInfo_endCursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PostConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.PostConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PostConnection_totalCount(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.TotalCount, 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.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PostConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PostConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _PostEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.PostEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PostEdge_node(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Node, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ent.Post)
|
|
fc.Result = res
|
|
return ec.marshalOPost2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPost(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PostEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PostEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Post_id(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Post_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Post_updatedAt(ctx, field)
|
|
case "expires":
|
|
return ec.fieldContext_Post_expires(ctx, field)
|
|
case "expireTime":
|
|
return ec.fieldContext_Post_expireTime(ctx, field)
|
|
case "title":
|
|
return ec.fieldContext_Post_title(ctx, field)
|
|
case "body":
|
|
return ec.fieldContext_Post_body(ctx, field)
|
|
case "category":
|
|
return ec.fieldContext_Post_category(ctx, field)
|
|
case "profile":
|
|
return ec.fieldContext_Post_profile(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Post", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _PostEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.PostEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_PostEdge_cursor(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Cursor, 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.(entgql.Cursor[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_PostEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "PostEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Cursor does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Profile_id(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_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) (interface{}, 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.(uuid.UUID)
|
|
fc.Result = res
|
|
return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
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) _Profile_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, 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.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Profile_updatedAt(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.UpdatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Time does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Profile_name(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_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) (interface{}, 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.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
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) _Profile_address(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_address(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Address, 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.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
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) _Profile_phone(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_phone(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Phone, 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.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_phone(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
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) _Profile_posts(ctx context.Context, field graphql.CollectedField, obj *ent.Profile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Profile_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Posts(ctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.PostOrder), fc.Args["where"].(*ent.PostWhereInput))
|
|
})
|
|
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.(*ent.PostConnection)
|
|
fc.Result = res
|
|
return ec.marshalNPostConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostConnection(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Profile_posts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Profile",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "edges":
|
|
return ec.fieldContext_PostConnection_edges(ctx, field)
|
|
case "pageInfo":
|
|
return ec.fieldContext_PostConnection_pageInfo(ctx, field)
|
|
case "totalCount":
|
|
return ec.fieldContext_PostConnection_totalCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PostConnection", 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_Profile_posts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ProfileConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.ProfileConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ProfileConnection_edges(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Edges, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*ent.ProfileEdge)
|
|
fc.Result = res
|
|
return ec.marshalOProfileEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileEdge(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ProfileConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ProfileConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "node":
|
|
return ec.fieldContext_ProfileEdge_node(ctx, field)
|
|
case "cursor":
|
|
return ec.fieldContext_ProfileEdge_cursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type ProfileEdge", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ProfileConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.ProfileConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ProfileConnection_pageInfo(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.PageInfo, 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.(entgql.PageInfo[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ProfileConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ProfileConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "hasNextPage":
|
|
return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
|
|
case "hasPreviousPage":
|
|
return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
|
|
case "startCursor":
|
|
return ec.fieldContext_PageInfo_startCursor(ctx, field)
|
|
case "endCursor":
|
|
return ec.fieldContext_PageInfo_endCursor(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ProfileConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.ProfileConnection) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ProfileConnection_totalCount(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.TotalCount, 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.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ProfileConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ProfileConnection",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _ProfileEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.ProfileEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ProfileEdge_node(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Node, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ent.Profile)
|
|
fc.Result = res
|
|
return ec.marshalOProfile2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfile(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ProfileEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ProfileEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "id":
|
|
return ec.fieldContext_Profile_id(ctx, field)
|
|
case "createdAt":
|
|
return ec.fieldContext_Profile_createdAt(ctx, field)
|
|
case "updatedAt":
|
|
return ec.fieldContext_Profile_updatedAt(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext_Profile_name(ctx, field)
|
|
case "address":
|
|
return ec.fieldContext_Profile_address(ctx, field)
|
|
case "phone":
|
|
return ec.fieldContext_Profile_phone(ctx, field)
|
|
case "posts":
|
|
return ec.fieldContext_Profile_posts(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ProfileEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.ProfileEdge) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ProfileEdge_cursor(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Cursor, 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.(entgql.Cursor[uuid.UUID])
|
|
fc.Result = res
|
|
return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_ProfileEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ProfileEdge",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Cursor does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_node(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_node(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Node(rctx, fc.Args["id"].(uuid.UUID))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(ent.Noder)
|
|
fc.Result = res
|
|
return ec.marshalONode2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐNoder(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_node(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) {
|
|
return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE")
|
|
},
|
|
}
|
|
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_node_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_nodes(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]uuid.UUID))
|
|
})
|
|
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.([]ent.Noder)
|
|
fc.Result = res
|
|
return ec.marshalNNode2ᚕcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐNoder(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_nodes(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) {
|
|
return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE")
|
|
},
|
|
}
|
|
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_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_categories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_categories(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.CategoryOrder), fc.Args["where"].(*ent.CategoryWhereInput))
|
|
})
|
|
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.(*ent.CategoryConnection)
|
|
fc.Result = res
|
|
return ec.marshalNCategoryConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryConnection(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_categories(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 "edges":
|
|
return ec.fieldContext_CategoryConnection_edges(ctx, field)
|
|
case "pageInfo":
|
|
return ec.fieldContext_CategoryConnection_pageInfo(ctx, field)
|
|
case "totalCount":
|
|
return ec.fieldContext_CategoryConnection_totalCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type CategoryConnection", 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_categories_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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Posts(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.PostOrder), fc.Args["where"].(*ent.PostWhereInput))
|
|
})
|
|
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.(*ent.PostConnection)
|
|
fc.Result = res
|
|
return ec.marshalNPostConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostConnection(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_posts(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 "edges":
|
|
return ec.fieldContext_PostConnection_edges(ctx, field)
|
|
case "pageInfo":
|
|
return ec.fieldContext_PostConnection_pageInfo(ctx, field)
|
|
case "totalCount":
|
|
return ec.fieldContext_PostConnection_totalCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type PostConnection", 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_posts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_profiles(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_profiles(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) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Profiles(rctx, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.ProfileOrder), fc.Args["where"].(*ent.ProfileWhereInput))
|
|
})
|
|
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.(*ent.ProfileConnection)
|
|
fc.Result = res
|
|
return ec.marshalNProfileConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileConnection(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_profiles(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 "edges":
|
|
return ec.fieldContext_ProfileConnection_edges(ctx, field)
|
|
case "pageInfo":
|
|
return ec.fieldContext_ProfileConnection_pageInfo(ctx, field)
|
|
case "totalCount":
|
|
return ec.fieldContext_ProfileConnection_totalCount(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type ProfileConnection", 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_profiles_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
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) (interface{}, 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 "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 "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(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) (interface{}, 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
|
|
}
|
|
|
|
// endregion **************************** field.gotpl *****************************
|
|
|
|
// region **************************** input.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj interface{}) (ent.CategoryOrder, error) {
|
|
var it ent.CategoryOrder
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
if _, present := asMap["direction"]; !present {
|
|
asMap["direction"] = "ASC"
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"direction", "field"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "direction":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction"))
|
|
data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Direction = data
|
|
case "field":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field"))
|
|
data, err := ec.unmarshalNCategoryOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryOrderField(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Field = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj interface{}) (ent.CategoryWhereInput, error) {
|
|
var it ent.CategoryWhereInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "title", "titleNEQ", "titleIn", "titleNotIn", "titleGT", "titleGTE", "titleLT", "titleLTE", "titleContains", "titleHasPrefix", "titleHasSuffix", "titleEqualFold", "titleContainsFold", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold", "hasPosts", "hasPostsWith"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "not":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not"))
|
|
data, err := ec.unmarshalOCategoryWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInput(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Not = data
|
|
case "and":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and"))
|
|
data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.And = data
|
|
case "or":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or"))
|
|
data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Or = data
|
|
case "id":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ID = data
|
|
case "idNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNEQ = data
|
|
case "idIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDIn = data
|
|
case "idNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNotIn = data
|
|
case "idGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGT = data
|
|
case "idGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGTE = data
|
|
case "idLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLT = data
|
|
case "idLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLTE = data
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "createdAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNEQ = data
|
|
case "createdAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtIn = data
|
|
case "createdAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNotIn = data
|
|
case "createdAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGT = data
|
|
case "createdAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGTE = data
|
|
case "createdAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLT = data
|
|
case "createdAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLTE = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "updatedAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNEQ = data
|
|
case "updatedAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIn = data
|
|
case "updatedAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotIn = data
|
|
case "updatedAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGT = data
|
|
case "updatedAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGTE = data
|
|
case "updatedAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLT = data
|
|
case "updatedAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLTE = data
|
|
case "updatedAtIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIsNil = data
|
|
case "updatedAtNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotNil = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "titleNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleNEQ = data
|
|
case "titleIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleIn = data
|
|
case "titleNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleNotIn = data
|
|
case "titleGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleGT = data
|
|
case "titleGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleGTE = data
|
|
case "titleLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleLT = data
|
|
case "titleLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleLTE = data
|
|
case "titleContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleContains = data
|
|
case "titleHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleHasPrefix = data
|
|
case "titleHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleHasSuffix = data
|
|
case "titleEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleEqualFold = data
|
|
case "titleContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleContainsFold = data
|
|
case "description":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Description = data
|
|
case "descriptionNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionNEQ = data
|
|
case "descriptionIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionIn = data
|
|
case "descriptionNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionNotIn = data
|
|
case "descriptionGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionGT = data
|
|
case "descriptionGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionGTE = data
|
|
case "descriptionLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionLT = data
|
|
case "descriptionLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionLTE = data
|
|
case "descriptionContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionContains = data
|
|
case "descriptionHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionHasPrefix = data
|
|
case "descriptionHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionHasSuffix = data
|
|
case "descriptionIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionIsNil = data
|
|
case "descriptionNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionNotNil = data
|
|
case "descriptionEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionEqualFold = data
|
|
case "descriptionContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.DescriptionContainsFold = data
|
|
case "hasPosts":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPosts"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasPosts = data
|
|
case "hasPostsWith":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPostsWith"))
|
|
data, err := ec.unmarshalOPostWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasPostsWith = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj interface{}) (ent.CreateCategoryInput, error) {
|
|
var it ent.CreateCategoryInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"createdAt", "updatedAt", "title", "description", "postIDs"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "description":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Description = data
|
|
case "postIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("postIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PostIDs = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputCreatePostInput(ctx context.Context, obj interface{}) (ent.CreatePostInput, error) {
|
|
var it ent.CreatePostInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"createdAt", "updatedAt", "expires", "expireTime", "title", "body", "categoryID", "profileID"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "expires":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Expires = data
|
|
case "expireTime":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTime"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTime = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "body":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body"))
|
|
data, err := ec.unmarshalNString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Body = data
|
|
case "categoryID":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CategoryID = data
|
|
case "profileID":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("profileID"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ProfileID = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputCreateProfileInput(ctx context.Context, obj interface{}) (ent.CreateProfileInput, error) {
|
|
var it ent.CreateProfileInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"createdAt", "updatedAt", "name", "address", "phone", "postIDs"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "name":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Name = data
|
|
case "address":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Address = data
|
|
case "phone":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phone"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Phone = data
|
|
case "postIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("postIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PostIDs = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputPostOrder(ctx context.Context, obj interface{}) (ent.PostOrder, error) {
|
|
var it ent.PostOrder
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
if _, present := asMap["direction"]; !present {
|
|
asMap["direction"] = "ASC"
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"direction", "field"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "direction":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction"))
|
|
data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Direction = data
|
|
case "field":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field"))
|
|
data, err := ec.unmarshalNPostOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrderField(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Field = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputPostWhereInput(ctx context.Context, obj interface{}) (ent.PostWhereInput, error) {
|
|
var it ent.PostWhereInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "expires", "expiresNEQ", "expireTime", "expireTimeNEQ", "expireTimeIn", "expireTimeNotIn", "expireTimeGT", "expireTimeGTE", "expireTimeLT", "expireTimeLTE", "expireTimeIsNil", "expireTimeNotNil", "title", "titleNEQ", "titleIn", "titleNotIn", "titleGT", "titleGTE", "titleLT", "titleLTE", "titleContains", "titleHasPrefix", "titleHasSuffix", "titleEqualFold", "titleContainsFold", "body", "bodyNEQ", "bodyIn", "bodyNotIn", "bodyGT", "bodyGTE", "bodyLT", "bodyLTE", "bodyContains", "bodyHasPrefix", "bodyHasSuffix", "bodyEqualFold", "bodyContainsFold", "hasCategory", "hasCategoryWith", "hasProfile", "hasProfileWith"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "not":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not"))
|
|
data, err := ec.unmarshalOPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Not = data
|
|
case "and":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and"))
|
|
data, err := ec.unmarshalOPostWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.And = data
|
|
case "or":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or"))
|
|
data, err := ec.unmarshalOPostWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Or = data
|
|
case "id":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ID = data
|
|
case "idNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNEQ = data
|
|
case "idIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDIn = data
|
|
case "idNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNotIn = data
|
|
case "idGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGT = data
|
|
case "idGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGTE = data
|
|
case "idLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLT = data
|
|
case "idLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLTE = data
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "createdAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNEQ = data
|
|
case "createdAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtIn = data
|
|
case "createdAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNotIn = data
|
|
case "createdAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGT = data
|
|
case "createdAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGTE = data
|
|
case "createdAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLT = data
|
|
case "createdAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLTE = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "updatedAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNEQ = data
|
|
case "updatedAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIn = data
|
|
case "updatedAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotIn = data
|
|
case "updatedAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGT = data
|
|
case "updatedAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGTE = data
|
|
case "updatedAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLT = data
|
|
case "updatedAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLTE = data
|
|
case "updatedAtIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIsNil = data
|
|
case "updatedAtNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotNil = data
|
|
case "expires":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Expires = data
|
|
case "expiresNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNEQ"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpiresNEQ = data
|
|
case "expireTime":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTime"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTime = data
|
|
case "expireTimeNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeNEQ = data
|
|
case "expireTimeIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeIn = data
|
|
case "expireTimeNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeNotIn = data
|
|
case "expireTimeGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeGT = data
|
|
case "expireTimeGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeGTE = data
|
|
case "expireTimeLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeLT = data
|
|
case "expireTimeLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeLTE = data
|
|
case "expireTimeIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeIsNil = data
|
|
case "expireTimeNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTimeNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTimeNotNil = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "titleNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleNEQ = data
|
|
case "titleIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleIn = data
|
|
case "titleNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleNotIn = data
|
|
case "titleGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleGT = data
|
|
case "titleGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleGTE = data
|
|
case "titleLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleLT = data
|
|
case "titleLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleLTE = data
|
|
case "titleContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleContains = data
|
|
case "titleHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleHasPrefix = data
|
|
case "titleHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleHasSuffix = data
|
|
case "titleEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleEqualFold = data
|
|
case "titleContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.TitleContainsFold = data
|
|
case "body":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Body = data
|
|
case "bodyNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyNEQ = data
|
|
case "bodyIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyIn = data
|
|
case "bodyNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyNotIn = data
|
|
case "bodyGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyGT = data
|
|
case "bodyGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyGTE = data
|
|
case "bodyLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyLT = data
|
|
case "bodyLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyLTE = data
|
|
case "bodyContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyContains = data
|
|
case "bodyHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyHasPrefix = data
|
|
case "bodyHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyHasSuffix = data
|
|
case "bodyEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyEqualFold = data
|
|
case "bodyContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bodyContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.BodyContainsFold = data
|
|
case "hasCategory":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasCategory"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasCategory = data
|
|
case "hasCategoryWith":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasCategoryWith"))
|
|
data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasCategoryWith = data
|
|
case "hasProfile":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasProfile"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasProfile = data
|
|
case "hasProfileWith":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasProfileWith"))
|
|
data, err := ec.unmarshalOProfileWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasProfileWith = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputProfileOrder(ctx context.Context, obj interface{}) (ent.ProfileOrder, error) {
|
|
var it ent.ProfileOrder
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
if _, present := asMap["direction"]; !present {
|
|
asMap["direction"] = "ASC"
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"direction", "field"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "direction":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction"))
|
|
data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Direction = data
|
|
case "field":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field"))
|
|
data, err := ec.unmarshalNProfileOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileOrderField(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Field = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputProfileWhereInput(ctx context.Context, obj interface{}) (ent.ProfileWhereInput, error) {
|
|
var it ent.ProfileWhereInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameIsNil", "nameNotNil", "nameEqualFold", "nameContainsFold", "address", "addressNEQ", "addressIn", "addressNotIn", "addressGT", "addressGTE", "addressLT", "addressLTE", "addressContains", "addressHasPrefix", "addressHasSuffix", "addressIsNil", "addressNotNil", "addressEqualFold", "addressContainsFold", "phone", "phoneNEQ", "phoneIn", "phoneNotIn", "phoneGT", "phoneGTE", "phoneLT", "phoneLTE", "phoneContains", "phoneHasPrefix", "phoneHasSuffix", "phoneIsNil", "phoneNotNil", "phoneEqualFold", "phoneContainsFold", "hasPosts", "hasPostsWith"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "not":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not"))
|
|
data, err := ec.unmarshalOProfileWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInput(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Not = data
|
|
case "and":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and"))
|
|
data, err := ec.unmarshalOProfileWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.And = data
|
|
case "or":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or"))
|
|
data, err := ec.unmarshalOProfileWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Or = data
|
|
case "id":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ID = data
|
|
case "idNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNEQ = data
|
|
case "idIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDIn = data
|
|
case "idNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDNotIn = data
|
|
case "idGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGT = data
|
|
case "idGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDGTE = data
|
|
case "idLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLT = data
|
|
case "idLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.IDLTE = data
|
|
case "createdAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAt = data
|
|
case "createdAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNEQ = data
|
|
case "createdAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtIn = data
|
|
case "createdAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtNotIn = data
|
|
case "createdAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGT = data
|
|
case "createdAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtGTE = data
|
|
case "createdAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLT = data
|
|
case "createdAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CreatedAtLTE = data
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "updatedAtNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNEQ = data
|
|
case "updatedAtIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIn = data
|
|
case "updatedAtNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn"))
|
|
data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotIn = data
|
|
case "updatedAtGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGT = data
|
|
case "updatedAtGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtGTE = data
|
|
case "updatedAtLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLT = data
|
|
case "updatedAtLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtLTE = data
|
|
case "updatedAtIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtIsNil = data
|
|
case "updatedAtNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAtNotNil = data
|
|
case "name":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Name = data
|
|
case "nameNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameNEQ = data
|
|
case "nameIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameIn = data
|
|
case "nameNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameNotIn = data
|
|
case "nameGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameGT = data
|
|
case "nameGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameGTE = data
|
|
case "nameLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameLT = data
|
|
case "nameLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameLTE = data
|
|
case "nameContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameContains = data
|
|
case "nameHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameHasPrefix = data
|
|
case "nameHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameHasSuffix = data
|
|
case "nameIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameIsNil = data
|
|
case "nameNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameNotNil = data
|
|
case "nameEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameEqualFold = data
|
|
case "nameContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.NameContainsFold = data
|
|
case "address":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Address = data
|
|
case "addressNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressNEQ = data
|
|
case "addressIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressIn = data
|
|
case "addressNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressNotIn = data
|
|
case "addressGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressGT = data
|
|
case "addressGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressGTE = data
|
|
case "addressLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressLT = data
|
|
case "addressLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressLTE = data
|
|
case "addressContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressContains = data
|
|
case "addressHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressHasPrefix = data
|
|
case "addressHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressHasSuffix = data
|
|
case "addressIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressIsNil = data
|
|
case "addressNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressNotNil = data
|
|
case "addressEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressEqualFold = data
|
|
case "addressContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddressContainsFold = data
|
|
case "phone":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phone"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Phone = data
|
|
case "phoneNEQ":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNEQ"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneNEQ = data
|
|
case "phoneIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneIn = data
|
|
case "phoneNotIn":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNotIn"))
|
|
data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneNotIn = data
|
|
case "phoneGT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneGT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneGT = data
|
|
case "phoneGTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneGTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneGTE = data
|
|
case "phoneLT":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneLT"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneLT = data
|
|
case "phoneLTE":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneLTE"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneLTE = data
|
|
case "phoneContains":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneContains"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneContains = data
|
|
case "phoneHasPrefix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneHasPrefix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneHasPrefix = data
|
|
case "phoneHasSuffix":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneHasSuffix"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneHasSuffix = data
|
|
case "phoneIsNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneIsNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneIsNil = data
|
|
case "phoneNotNil":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNotNil"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneNotNil = data
|
|
case "phoneEqualFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneEqualFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneEqualFold = data
|
|
case "phoneContainsFold":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneContainsFold"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.PhoneContainsFold = data
|
|
case "hasPosts":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPosts"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasPosts = data
|
|
case "hasPostsWith":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPostsWith"))
|
|
data, err := ec.unmarshalOPostWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInputᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.HasPostsWith = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUpdateCategoryInput(ctx context.Context, obj interface{}) (ent.UpdateCategoryInput, error) {
|
|
var it ent.UpdateCategoryInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"updatedAt", "clearUpdatedAt", "title", "description", "clearDescription", "addPostIDs", "removePostIDs", "clearPosts"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "clearUpdatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUpdatedAt"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearUpdatedAt = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "description":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Description = data
|
|
case "clearDescription":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearDescription = data
|
|
case "addPostIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPostIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddPostIDs = data
|
|
case "removePostIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePostIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.RemovePostIDs = data
|
|
case "clearPosts":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPosts"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearPosts = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUpdatePostInput(ctx context.Context, obj interface{}) (ent.UpdatePostInput, error) {
|
|
var it ent.UpdatePostInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"updatedAt", "clearUpdatedAt", "expires", "expireTime", "clearExpireTime", "title", "body", "categoryID", "clearCategory", "profileID", "clearProfile"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "clearUpdatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUpdatedAt"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearUpdatedAt = data
|
|
case "expires":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires"))
|
|
data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Expires = data
|
|
case "expireTime":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expireTime"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ExpireTime = data
|
|
case "clearExpireTime":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExpireTime"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearExpireTime = data
|
|
case "title":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Title = data
|
|
case "body":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Body = data
|
|
case "categoryID":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.CategoryID = data
|
|
case "clearCategory":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearCategory"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearCategory = data
|
|
case "profileID":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("profileID"))
|
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ProfileID = data
|
|
case "clearProfile":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearProfile"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearProfile = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context, obj interface{}) (ent.UpdateProfileInput, error) {
|
|
var it ent.UpdateProfileInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"updatedAt", "clearUpdatedAt", "name", "clearName", "address", "clearAddress", "phone", "clearPhone", "addPostIDs", "removePostIDs", "clearPosts"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "updatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt"))
|
|
data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.UpdatedAt = data
|
|
case "clearUpdatedAt":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUpdatedAt"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearUpdatedAt = data
|
|
case "name":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Name = data
|
|
case "clearName":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearName"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearName = data
|
|
case "address":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Address = data
|
|
case "clearAddress":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAddress"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearAddress = data
|
|
case "phone":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phone"))
|
|
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Phone = data
|
|
case "clearPhone":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPhone"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearPhone = data
|
|
case "addPostIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPostIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.AddPostIDs = data
|
|
case "removePostIDs":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePostIDs"))
|
|
data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.RemovePostIDs = data
|
|
case "clearPosts":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPosts"))
|
|
data, err := ec.unmarshalOBoolean2bool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.ClearPosts = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
// endregion **************************** input.gotpl *****************************
|
|
|
|
// region ************************** interface.gotpl ***************************
|
|
|
|
func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj ent.Noder) graphql.Marshaler {
|
|
switch obj := (obj).(type) {
|
|
case nil:
|
|
return graphql.Null
|
|
case *ent.Category:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Category(ctx, sel, obj)
|
|
case *ent.Post:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Post(ctx, sel, obj)
|
|
case *ent.Profile:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Profile(ctx, sel, obj)
|
|
default:
|
|
panic(fmt.Errorf("unexpected type %T", obj))
|
|
}
|
|
}
|
|
|
|
// endregion ************************** interface.gotpl ***************************
|
|
|
|
// region **************************** object.gotpl ****************************
|
|
|
|
var categoryImplementors = []string{"Category", "Node"}
|
|
|
|
func (ec *executionContext) _Category(ctx context.Context, sel ast.SelectionSet, obj *ent.Category) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, categoryImplementors)
|
|
|
|
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("Category")
|
|
case "id":
|
|
out.Values[i] = ec._Category_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "createdAt":
|
|
out.Values[i] = ec._Category_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "updatedAt":
|
|
out.Values[i] = ec._Category_updatedAt(ctx, field, obj)
|
|
case "title":
|
|
out.Values[i] = ec._Category_title(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec._Category_description(ctx, field, obj)
|
|
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._Category_posts(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 categoryConnectionImplementors = []string{"CategoryConnection"}
|
|
|
|
func (ec *executionContext) _CategoryConnection(ctx context.Context, sel ast.SelectionSet, obj *ent.CategoryConnection) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, categoryConnectionImplementors)
|
|
|
|
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("CategoryConnection")
|
|
case "edges":
|
|
out.Values[i] = ec._CategoryConnection_edges(ctx, field, obj)
|
|
case "pageInfo":
|
|
out.Values[i] = ec._CategoryConnection_pageInfo(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "totalCount":
|
|
out.Values[i] = ec._CategoryConnection_totalCount(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 categoryEdgeImplementors = []string{"CategoryEdge"}
|
|
|
|
func (ec *executionContext) _CategoryEdge(ctx context.Context, sel ast.SelectionSet, obj *ent.CategoryEdge) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, categoryEdgeImplementors)
|
|
|
|
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("CategoryEdge")
|
|
case "node":
|
|
out.Values[i] = ec._CategoryEdge_node(ctx, field, obj)
|
|
case "cursor":
|
|
out.Values[i] = ec._CategoryEdge_cursor(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 pageInfoImplementors = []string{"PageInfo"}
|
|
|
|
func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *entgql.PageInfo[uuid.UUID]) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors)
|
|
|
|
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("PageInfo")
|
|
case "hasNextPage":
|
|
out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "hasPreviousPage":
|
|
out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "startCursor":
|
|
out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj)
|
|
case "endCursor":
|
|
out.Values[i] = ec._PageInfo_endCursor(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 postImplementors = []string{"Post", "Node"}
|
|
|
|
func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj *ent.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 "createdAt":
|
|
out.Values[i] = ec._Post_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "updatedAt":
|
|
out.Values[i] = ec._Post_updatedAt(ctx, field, obj)
|
|
case "expires":
|
|
out.Values[i] = ec._Post_expires(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "expireTime":
|
|
out.Values[i] = ec._Post_expireTime(ctx, field, obj)
|
|
case "title":
|
|
out.Values[i] = ec._Post_title(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "body":
|
|
out.Values[i] = ec._Post_body(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "category":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_category(ctx, field, obj)
|
|
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 "profile":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Post_profile(ctx, field, obj)
|
|
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 postConnectionImplementors = []string{"PostConnection"}
|
|
|
|
func (ec *executionContext) _PostConnection(ctx context.Context, sel ast.SelectionSet, obj *ent.PostConnection) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, postConnectionImplementors)
|
|
|
|
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("PostConnection")
|
|
case "edges":
|
|
out.Values[i] = ec._PostConnection_edges(ctx, field, obj)
|
|
case "pageInfo":
|
|
out.Values[i] = ec._PostConnection_pageInfo(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "totalCount":
|
|
out.Values[i] = ec._PostConnection_totalCount(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 postEdgeImplementors = []string{"PostEdge"}
|
|
|
|
func (ec *executionContext) _PostEdge(ctx context.Context, sel ast.SelectionSet, obj *ent.PostEdge) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, postEdgeImplementors)
|
|
|
|
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("PostEdge")
|
|
case "node":
|
|
out.Values[i] = ec._PostEdge_node(ctx, field, obj)
|
|
case "cursor":
|
|
out.Values[i] = ec._PostEdge_cursor(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 profileImplementors = []string{"Profile", "Node"}
|
|
|
|
func (ec *executionContext) _Profile(ctx context.Context, sel ast.SelectionSet, obj *ent.Profile) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, profileImplementors)
|
|
|
|
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("Profile")
|
|
case "id":
|
|
out.Values[i] = ec._Profile_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "createdAt":
|
|
out.Values[i] = ec._Profile_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&out.Invalids, 1)
|
|
}
|
|
case "updatedAt":
|
|
out.Values[i] = ec._Profile_updatedAt(ctx, field, obj)
|
|
case "name":
|
|
out.Values[i] = ec._Profile_name(ctx, field, obj)
|
|
case "address":
|
|
out.Values[i] = ec._Profile_address(ctx, field, obj)
|
|
case "phone":
|
|
out.Values[i] = ec._Profile_phone(ctx, field, obj)
|
|
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._Profile_posts(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 profileConnectionImplementors = []string{"ProfileConnection"}
|
|
|
|
func (ec *executionContext) _ProfileConnection(ctx context.Context, sel ast.SelectionSet, obj *ent.ProfileConnection) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, profileConnectionImplementors)
|
|
|
|
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("ProfileConnection")
|
|
case "edges":
|
|
out.Values[i] = ec._ProfileConnection_edges(ctx, field, obj)
|
|
case "pageInfo":
|
|
out.Values[i] = ec._ProfileConnection_pageInfo(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "totalCount":
|
|
out.Values[i] = ec._ProfileConnection_totalCount(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 profileEdgeImplementors = []string{"ProfileEdge"}
|
|
|
|
func (ec *executionContext) _ProfileEdge(ctx context.Context, sel ast.SelectionSet, obj *ent.ProfileEdge) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, profileEdgeImplementors)
|
|
|
|
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("ProfileEdge")
|
|
case "node":
|
|
out.Values[i] = ec._ProfileEdge_node(ctx, field, obj)
|
|
case "cursor":
|
|
out.Values[i] = ec._ProfileEdge_cursor(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 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 "node":
|
|
field := field
|
|
|
|
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_node(ctx, field)
|
|
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 "nodes":
|
|
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_nodes(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 "categories":
|
|
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_categories(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 "profiles":
|
|
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_profiles(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
|
|
}
|
|
|
|
// endregion **************************** object.gotpl ****************************
|
|
|
|
// region ***************************** type.gotpl *****************************
|
|
|
|
func (ec *executionContext) marshalNCategoryConnection2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryConnection(ctx context.Context, sel ast.SelectionSet, v ent.CategoryConnection) graphql.Marshaler {
|
|
return ec._CategoryConnection(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNCategoryConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryConnection(ctx context.Context, sel ast.SelectionSet, v *ent.CategoryConnection) 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._CategoryConnection(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNCategoryOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryOrderField(ctx context.Context, v interface{}) (*ent.CategoryOrderField, error) {
|
|
var res = new(ent.CategoryOrderField)
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNCategoryOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryOrderField(ctx context.Context, sel ast.SelectionSet, v *ent.CategoryOrderField) 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 v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNCategoryWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInput(ctx context.Context, v interface{}) (*ent.CategoryWhereInput, error) {
|
|
res, err := ec.unmarshalInputCategoryWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, v interface{}) (entgql.Cursor[uuid.UUID], error) {
|
|
var res entgql.Cursor[uuid.UUID]
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v entgql.Cursor[uuid.UUID]) graphql.Marshaler {
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) marshalNNode2ᚕcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v []ent.Noder) 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.marshalONode2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐNoder(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx context.Context, v interface{}) (entgql.OrderDirection, error) {
|
|
var res entgql.OrderDirection
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx context.Context, sel ast.SelectionSet, v entgql.OrderDirection) graphql.Marshaler {
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v entgql.PageInfo[uuid.UUID]) graphql.Marshaler {
|
|
return ec._PageInfo(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPostConnection2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostConnection(ctx context.Context, sel ast.SelectionSet, v ent.PostConnection) graphql.Marshaler {
|
|
return ec._PostConnection(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPostConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostConnection(ctx context.Context, sel ast.SelectionSet, v *ent.PostConnection) 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._PostConnection(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNPostOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrderField(ctx context.Context, v interface{}) (*ent.PostOrderField, error) {
|
|
var res = new(ent.PostOrderField)
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNPostOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrderField(ctx context.Context, sel ast.SelectionSet, v *ent.PostOrderField) 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 v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx context.Context, v interface{}) (*ent.PostWhereInput, error) {
|
|
res, err := ec.unmarshalInputPostWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfileConnection2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileConnection(ctx context.Context, sel ast.SelectionSet, v ent.ProfileConnection) graphql.Marshaler {
|
|
return ec._ProfileConnection(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfileConnection2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileConnection(ctx context.Context, sel ast.SelectionSet, v *ent.ProfileConnection) 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._ProfileConnection(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNProfileOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileOrderField(ctx context.Context, v interface{}) (*ent.ProfileOrderField, error) {
|
|
var res = new(ent.ProfileOrderField)
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfileOrderField2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileOrderField(ctx context.Context, sel ast.SelectionSet, v *ent.ProfileOrderField) 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 v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNProfileWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInput(ctx context.Context, v interface{}) (*ent.ProfileWhereInput, error) {
|
|
res, err := ec.unmarshalInputProfileWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {
|
|
res := graphql.MarshalTime(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) marshalOCategory2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategory(ctx context.Context, sel ast.SelectionSet, v *ent.Category) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Category(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOCategoryEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.CategoryEdge) 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.marshalOCategoryEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryEdge(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOCategoryEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryEdge(ctx context.Context, sel ast.SelectionSet, v *ent.CategoryEdge) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._CategoryEdge(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOCategoryOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryOrder(ctx context.Context, v interface{}) (*ent.CategoryOrder, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputCategoryOrder(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOCategoryWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.CategoryWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]*ent.CategoryWhereInput, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNCategoryWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInput(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOCategoryWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐCategoryWhereInput(ctx context.Context, v interface{}) (*ent.CategoryWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputCategoryWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, v interface{}) (*entgql.Cursor[uuid.UUID], error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var res = new(entgql.Cursor[uuid.UUID])
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v *entgql.Cursor[uuid.UUID]) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) marshalONode2codeᚗicodᚗdeᚋdaluᚋkaᚋentᚐNoder(ctx context.Context, sel ast.SelectionSet, v ent.Noder) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Node(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOPost2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPost(ctx context.Context, sel ast.SelectionSet, v *ent.Post) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Post(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOPostEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.PostEdge) 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.marshalOPostEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostEdge(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOPostEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostEdge(ctx context.Context, sel ast.SelectionSet, v *ent.PostEdge) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._PostEdge(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOPostOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostOrder(ctx context.Context, v interface{}) (*ent.PostOrder, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputPostOrder(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOPostWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.PostWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]*ent.PostWhereInput, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOPostWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐPostWhereInput(ctx context.Context, v interface{}) (*ent.PostWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputPostWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProfile2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfile(ctx context.Context, sel ast.SelectionSet, v *ent.Profile) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Profile(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProfileEdge2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileEdge(ctx context.Context, sel ast.SelectionSet, v []*ent.ProfileEdge) 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.marshalOProfileEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileEdge(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProfileEdge2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileEdge(ctx context.Context, sel ast.SelectionSet, v *ent.ProfileEdge) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._ProfileEdge(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOProfileOrder2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileOrder(ctx context.Context, v interface{}) (*ent.ProfileOrder, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputProfileOrder(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOProfileWhereInput2ᚕᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInputᚄ(ctx context.Context, v interface{}) ([]*ent.ProfileWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]*ent.ProfileWhereInput, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNProfileWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInput(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOProfileWhereInput2ᚖcodeᚗicodᚗdeᚋdaluᚋkaᚋentᚐProfileWhereInput(ctx context.Context, v interface{}) (*ent.ProfileWhereInput, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputProfileWhereInput(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {
|
|
res := graphql.MarshalTime(v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx context.Context, v interface{}) ([]time.Time, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]time.Time, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNTime2timeᚐTime(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOTime2ᚕtimeᚐTimeᚄ(ctx context.Context, sel ast.SelectionSet, v []time.Time) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNTime2timeᚐTime(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalTime(*v)
|
|
return res
|
|
}
|
|
|
|
// endregion ***************************** type.gotpl *****************************
|