diff --git a/entgql/annotation.go b/entgql/annotation.go index c423e905f..058aa2245 100644 --- a/entgql/annotation.go +++ b/entgql/annotation.go @@ -57,6 +57,10 @@ type ( Directive struct { Name string `json:"name,omitempty"` Arguments []*ast.Argument `json:"arguments,omitempty"` + + SkipTypeField bool `json:"skipOnTypeField,omitempty"` + AddCreateMutationField bool `json:"onInputMutationField,omitempty"` + AddUpdateMutationField bool `json:"onUpdateMutationField,omitempty"` } // SkipMode is a bit flag for the Skip annotation. @@ -80,6 +84,21 @@ type ( } ) +func (d Directive) SkipOnTypeField() Directive { + d.SkipTypeField = true + return d +} + +func (d Directive) OnCreateMutationField() Directive { + d.AddCreateMutationField = true + return d +} + +func (d Directive) OnUpdateMutationField() Directive { + d.AddUpdateMutationField = true + return d +} + const ( // SkipType skips generating GraphQL types or fields in the schema. SkipType SkipMode = 1 << iota diff --git a/entgql/internal/todo/ent.graphql b/entgql/internal/todo/ent.graphql index 03c085a81..2be156791 100644 --- a/entgql/internal/todo/ent.graphql +++ b/entgql/internal/todo/ent.graphql @@ -310,6 +310,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -342,6 +353,124 @@ Define a Relay Cursor type: https://relay.dev/graphql/connections.htm#sec-Cursor """ scalar Cursor +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -836,6 +965,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -1203,6 +1333,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ diff --git a/entgql/internal/todo/ent.resolvers.go b/entgql/internal/todo/ent.resolvers.go index 1bd306410..4d2ccce03 100644 --- a/entgql/internal/todo/ent.resolvers.go +++ b/entgql/internal/todo/ent.resolvers.go @@ -20,6 +20,7 @@ package todo import ( "context" + "fmt" "entgo.io/contrib/entgql" "entgo.io/contrib/entgql/internal/todo/ent" @@ -49,6 +50,11 @@ func (r *queryResolver) Categories(ctx context.Context, after *entgql.Cursor[int ) } +// DirectiveExamples is the resolver for the directiveExamples field. +func (r *queryResolver) DirectiveExamples(ctx context.Context) ([]*ent.DirectiveExample, error) { + return []*ent.DirectiveExample{}, fmt.Errorf("not implemented: DirectiveExamples - directiveExamples") +} + // Groups is the resolver for the groups field. func (r *queryResolver) Groups(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) { return r.client.Group.Query(). diff --git a/entgql/internal/todo/ent/client.go b/entgql/internal/todo/ent/client.go index feaf9096c..d11f23111 100644 --- a/entgql/internal/todo/ent/client.go +++ b/entgql/internal/todo/ent/client.go @@ -28,6 +28,7 @@ import ( "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -50,6 +51,8 @@ type Client struct { BillProduct *BillProductClient // Category is the client for interacting with the Category builders. Category *CategoryClient + // DirectiveExample is the client for interacting with the DirectiveExample builders. + DirectiveExample *DirectiveExampleClient // Friendship is the client for interacting with the Friendship builders. Friendship *FriendshipClient // Group is the client for interacting with the Group builders. @@ -81,6 +84,7 @@ func (c *Client) init() { c.Schema = migrate.NewSchema(c.driver) c.BillProduct = NewBillProductClient(c.config) c.Category = NewCategoryClient(c.config) + c.DirectiveExample = NewDirectiveExampleClient(c.config) c.Friendship = NewFriendshipClient(c.config) c.Group = NewGroupClient(c.config) c.OneToMany = NewOneToManyClient(c.config) @@ -179,18 +183,19 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) { cfg := c.config cfg.driver = tx return &Tx{ - ctx: ctx, - config: cfg, - BillProduct: NewBillProductClient(cfg), - Category: NewCategoryClient(cfg), - Friendship: NewFriendshipClient(cfg), - Group: NewGroupClient(cfg), - OneToMany: NewOneToManyClient(cfg), - Project: NewProjectClient(cfg), - Todo: NewTodoClient(cfg), - User: NewUserClient(cfg), - VerySecret: NewVerySecretClient(cfg), - Workspace: NewWorkspaceClient(cfg), + ctx: ctx, + config: cfg, + BillProduct: NewBillProductClient(cfg), + Category: NewCategoryClient(cfg), + DirectiveExample: NewDirectiveExampleClient(cfg), + Friendship: NewFriendshipClient(cfg), + Group: NewGroupClient(cfg), + OneToMany: NewOneToManyClient(cfg), + Project: NewProjectClient(cfg), + Todo: NewTodoClient(cfg), + User: NewUserClient(cfg), + VerySecret: NewVerySecretClient(cfg), + Workspace: NewWorkspaceClient(cfg), }, nil } @@ -208,18 +213,19 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) cfg := c.config cfg.driver = &txDriver{tx: tx, drv: c.driver} return &Tx{ - ctx: ctx, - config: cfg, - BillProduct: NewBillProductClient(cfg), - Category: NewCategoryClient(cfg), - Friendship: NewFriendshipClient(cfg), - Group: NewGroupClient(cfg), - OneToMany: NewOneToManyClient(cfg), - Project: NewProjectClient(cfg), - Todo: NewTodoClient(cfg), - User: NewUserClient(cfg), - VerySecret: NewVerySecretClient(cfg), - Workspace: NewWorkspaceClient(cfg), + ctx: ctx, + config: cfg, + BillProduct: NewBillProductClient(cfg), + Category: NewCategoryClient(cfg), + DirectiveExample: NewDirectiveExampleClient(cfg), + Friendship: NewFriendshipClient(cfg), + Group: NewGroupClient(cfg), + OneToMany: NewOneToManyClient(cfg), + Project: NewProjectClient(cfg), + Todo: NewTodoClient(cfg), + User: NewUserClient(cfg), + VerySecret: NewVerySecretClient(cfg), + Workspace: NewWorkspaceClient(cfg), }, nil } @@ -249,8 +255,8 @@ func (c *Client) Close() error { // In order to add hooks to a specific client, call: `client.Node.Use(...)`. func (c *Client) Use(hooks ...Hook) { for _, n := range []interface{ Use(...Hook) }{ - c.BillProduct, c.Category, c.Friendship, c.Group, c.OneToMany, c.Project, - c.Todo, c.User, c.VerySecret, c.Workspace, + c.BillProduct, c.Category, c.DirectiveExample, c.Friendship, c.Group, + c.OneToMany, c.Project, c.Todo, c.User, c.VerySecret, c.Workspace, } { n.Use(hooks...) } @@ -260,8 +266,8 @@ func (c *Client) Use(hooks ...Hook) { // In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. func (c *Client) Intercept(interceptors ...Interceptor) { for _, n := range []interface{ Intercept(...Interceptor) }{ - c.BillProduct, c.Category, c.Friendship, c.Group, c.OneToMany, c.Project, - c.Todo, c.User, c.VerySecret, c.Workspace, + c.BillProduct, c.Category, c.DirectiveExample, c.Friendship, c.Group, + c.OneToMany, c.Project, c.Todo, c.User, c.VerySecret, c.Workspace, } { n.Intercept(interceptors...) } @@ -274,6 +280,8 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { return c.BillProduct.mutate(ctx, m) case *CategoryMutation: return c.Category.mutate(ctx, m) + case *DirectiveExampleMutation: + return c.DirectiveExample.mutate(ctx, m) case *FriendshipMutation: return c.Friendship.mutate(ctx, m) case *GroupMutation: @@ -593,6 +601,139 @@ func (c *CategoryClient) mutate(ctx context.Context, m *CategoryMutation) (Value } } +// DirectiveExampleClient is a client for the DirectiveExample schema. +type DirectiveExampleClient struct { + config +} + +// NewDirectiveExampleClient returns a client for the DirectiveExample from the given config. +func NewDirectiveExampleClient(c config) *DirectiveExampleClient { + return &DirectiveExampleClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `directiveexample.Hooks(f(g(h())))`. +func (c *DirectiveExampleClient) Use(hooks ...Hook) { + c.hooks.DirectiveExample = append(c.hooks.DirectiveExample, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `directiveexample.Intercept(f(g(h())))`. +func (c *DirectiveExampleClient) Intercept(interceptors ...Interceptor) { + c.inters.DirectiveExample = append(c.inters.DirectiveExample, interceptors...) +} + +// Create returns a builder for creating a DirectiveExample entity. +func (c *DirectiveExampleClient) Create() *DirectiveExampleCreate { + mutation := newDirectiveExampleMutation(c.config, OpCreate) + return &DirectiveExampleCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of DirectiveExample entities. +func (c *DirectiveExampleClient) CreateBulk(builders ...*DirectiveExampleCreate) *DirectiveExampleCreateBulk { + return &DirectiveExampleCreateBulk{config: c.config, builders: builders} +} + +// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates +// a builder and applies setFunc on it. +func (c *DirectiveExampleClient) MapCreateBulk(slice any, setFunc func(*DirectiveExampleCreate, int)) *DirectiveExampleCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &DirectiveExampleCreateBulk{err: fmt.Errorf("calling to DirectiveExampleClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*DirectiveExampleCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &DirectiveExampleCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for DirectiveExample. +func (c *DirectiveExampleClient) Update() *DirectiveExampleUpdate { + mutation := newDirectiveExampleMutation(c.config, OpUpdate) + return &DirectiveExampleUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *DirectiveExampleClient) UpdateOne(de *DirectiveExample) *DirectiveExampleUpdateOne { + mutation := newDirectiveExampleMutation(c.config, OpUpdateOne, withDirectiveExample(de)) + return &DirectiveExampleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *DirectiveExampleClient) UpdateOneID(id int) *DirectiveExampleUpdateOne { + mutation := newDirectiveExampleMutation(c.config, OpUpdateOne, withDirectiveExampleID(id)) + return &DirectiveExampleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for DirectiveExample. +func (c *DirectiveExampleClient) Delete() *DirectiveExampleDelete { + mutation := newDirectiveExampleMutation(c.config, OpDelete) + return &DirectiveExampleDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *DirectiveExampleClient) DeleteOne(de *DirectiveExample) *DirectiveExampleDeleteOne { + return c.DeleteOneID(de.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *DirectiveExampleClient) DeleteOneID(id int) *DirectiveExampleDeleteOne { + builder := c.Delete().Where(directiveexample.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &DirectiveExampleDeleteOne{builder} +} + +// Query returns a query builder for DirectiveExample. +func (c *DirectiveExampleClient) Query() *DirectiveExampleQuery { + return &DirectiveExampleQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeDirectiveExample}, + inters: c.Interceptors(), + } +} + +// Get returns a DirectiveExample entity by its id. +func (c *DirectiveExampleClient) Get(ctx context.Context, id int) (*DirectiveExample, error) { + return c.Query().Where(directiveexample.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *DirectiveExampleClient) GetX(ctx context.Context, id int) *DirectiveExample { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *DirectiveExampleClient) Hooks() []Hook { + return c.hooks.DirectiveExample +} + +// Interceptors returns the client interceptors. +func (c *DirectiveExampleClient) Interceptors() []Interceptor { + return c.inters.DirectiveExample +} + +func (c *DirectiveExampleClient) mutate(ctx context.Context, m *DirectiveExampleMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&DirectiveExampleCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&DirectiveExampleUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&DirectiveExampleUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&DirectiveExampleDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("ent: unknown DirectiveExample mutation op: %q", m.Op()) + } +} + // FriendshipClient is a client for the Friendship schema. type FriendshipClient struct { config @@ -1868,11 +2009,11 @@ func (c *WorkspaceClient) mutate(ctx context.Context, m *WorkspaceMutation) (Val // hooks and interceptors per client, for fast access. type ( hooks struct { - BillProduct, Category, Friendship, Group, OneToMany, Project, Todo, User, - VerySecret, Workspace []ent.Hook + BillProduct, Category, DirectiveExample, Friendship, Group, OneToMany, Project, + Todo, User, VerySecret, Workspace []ent.Hook } inters struct { - BillProduct, Category, Friendship, Group, OneToMany, Project, Todo, User, - VerySecret, Workspace []ent.Interceptor + BillProduct, Category, DirectiveExample, Friendship, Group, OneToMany, Project, + Todo, User, VerySecret, Workspace []ent.Interceptor } ) diff --git a/entgql/internal/todo/ent/directiveexample.go b/entgql/internal/todo/ent/directiveexample.go new file mode 100644 index 000000000..b2e4ec18b --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample.go @@ -0,0 +1,161 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package ent + +import ( + "fmt" + "strings" + + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" + "entgo.io/ent" + "entgo.io/ent/dialect/sql" +) + +// DirectiveExample is the model entity for the DirectiveExample schema. +type DirectiveExample struct { + config `json:"-"` + // ID of the ent. + ID int `json:"id,omitempty"` + // OnTypeField holds the value of the "on_type_field" field. + OnTypeField string `json:"on_type_field,omitempty"` + // OnMutationFields holds the value of the "on_mutation_fields" field. + OnMutationFields string `json:"on_mutation_fields,omitempty"` + // OnMutationCreate holds the value of the "on_mutation_create" field. + OnMutationCreate string `json:"on_mutation_create,omitempty"` + // OnMutationUpdate holds the value of the "on_mutation_update" field. + OnMutationUpdate string `json:"on_mutation_update,omitempty"` + // OnAllFields holds the value of the "on_all_fields" field. + OnAllFields string `json:"on_all_fields,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*DirectiveExample) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case directiveexample.FieldID: + values[i] = new(sql.NullInt64) + case directiveexample.FieldOnTypeField, directiveexample.FieldOnMutationFields, directiveexample.FieldOnMutationCreate, directiveexample.FieldOnMutationUpdate, directiveexample.FieldOnAllFields: + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the DirectiveExample fields. +func (de *DirectiveExample) assignValues(columns []string, values []any) error { + if m, n := len(values), len(columns); m < n { + return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) + } + for i := range columns { + switch columns[i] { + case directiveexample.FieldID: + value, ok := values[i].(*sql.NullInt64) + if !ok { + return fmt.Errorf("unexpected type %T for field id", value) + } + de.ID = int(value.Int64) + case directiveexample.FieldOnTypeField: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field on_type_field", values[i]) + } else if value.Valid { + de.OnTypeField = value.String + } + case directiveexample.FieldOnMutationFields: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field on_mutation_fields", values[i]) + } else if value.Valid { + de.OnMutationFields = value.String + } + case directiveexample.FieldOnMutationCreate: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field on_mutation_create", values[i]) + } else if value.Valid { + de.OnMutationCreate = value.String + } + case directiveexample.FieldOnMutationUpdate: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field on_mutation_update", values[i]) + } else if value.Valid { + de.OnMutationUpdate = value.String + } + case directiveexample.FieldOnAllFields: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field on_all_fields", values[i]) + } else if value.Valid { + de.OnAllFields = value.String + } + default: + de.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the DirectiveExample. +// This includes values selected through modifiers, order, etc. +func (de *DirectiveExample) Value(name string) (ent.Value, error) { + return de.selectValues.Get(name) +} + +// Update returns a builder for updating this DirectiveExample. +// Note that you need to call DirectiveExample.Unwrap() before calling this method if this DirectiveExample +// was returned from a transaction, and the transaction was committed or rolled back. +func (de *DirectiveExample) Update() *DirectiveExampleUpdateOne { + return NewDirectiveExampleClient(de.config).UpdateOne(de) +} + +// Unwrap unwraps the DirectiveExample entity that was returned from a transaction after it was closed, +// so that all future queries will be executed through the driver which created the transaction. +func (de *DirectiveExample) Unwrap() *DirectiveExample { + _tx, ok := de.config.driver.(*txDriver) + if !ok { + panic("ent: DirectiveExample is not a transactional entity") + } + de.config.driver = _tx.drv + return de +} + +// String implements the fmt.Stringer. +func (de *DirectiveExample) String() string { + var builder strings.Builder + builder.WriteString("DirectiveExample(") + builder.WriteString(fmt.Sprintf("id=%v, ", de.ID)) + builder.WriteString("on_type_field=") + builder.WriteString(de.OnTypeField) + builder.WriteString(", ") + builder.WriteString("on_mutation_fields=") + builder.WriteString(de.OnMutationFields) + builder.WriteString(", ") + builder.WriteString("on_mutation_create=") + builder.WriteString(de.OnMutationCreate) + builder.WriteString(", ") + builder.WriteString("on_mutation_update=") + builder.WriteString(de.OnMutationUpdate) + builder.WriteString(", ") + builder.WriteString("on_all_fields=") + builder.WriteString(de.OnAllFields) + builder.WriteByte(')') + return builder.String() +} + +// DirectiveExamples is a parsable slice of DirectiveExample. +type DirectiveExamples []*DirectiveExample diff --git a/entgql/internal/todo/ent/directiveexample/directiveexample.go b/entgql/internal/todo/ent/directiveexample/directiveexample.go new file mode 100644 index 000000000..126705475 --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample/directiveexample.go @@ -0,0 +1,93 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package directiveexample + +import ( + "entgo.io/ent/dialect/sql" +) + +const ( + // Label holds the string label denoting the directiveexample type in the database. + Label = "directive_example" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldOnTypeField holds the string denoting the on_type_field field in the database. + FieldOnTypeField = "on_type_field" + // FieldOnMutationFields holds the string denoting the on_mutation_fields field in the database. + FieldOnMutationFields = "on_mutation_fields" + // FieldOnMutationCreate holds the string denoting the on_mutation_create field in the database. + FieldOnMutationCreate = "on_mutation_create" + // FieldOnMutationUpdate holds the string denoting the on_mutation_update field in the database. + FieldOnMutationUpdate = "on_mutation_update" + // FieldOnAllFields holds the string denoting the on_all_fields field in the database. + FieldOnAllFields = "on_all_fields" + // Table holds the table name of the directiveexample in the database. + Table = "directive_examples" +) + +// Columns holds all SQL columns for directiveexample fields. +var Columns = []string{ + FieldID, + FieldOnTypeField, + FieldOnMutationFields, + FieldOnMutationCreate, + FieldOnMutationUpdate, + FieldOnAllFields, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// OrderOption defines the ordering options for the DirectiveExample queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByOnTypeField orders the results by the on_type_field field. +func ByOnTypeField(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOnTypeField, opts...).ToFunc() +} + +// ByOnMutationFields orders the results by the on_mutation_fields field. +func ByOnMutationFields(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOnMutationFields, opts...).ToFunc() +} + +// ByOnMutationCreate orders the results by the on_mutation_create field. +func ByOnMutationCreate(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOnMutationCreate, opts...).ToFunc() +} + +// ByOnMutationUpdate orders the results by the on_mutation_update field. +func ByOnMutationUpdate(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOnMutationUpdate, opts...).ToFunc() +} + +// ByOnAllFields orders the results by the on_all_fields field. +func ByOnAllFields(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOnAllFields, opts...).ToFunc() +} diff --git a/entgql/internal/todo/ent/directiveexample/where.go b/entgql/internal/todo/ent/directiveexample/where.go new file mode 100644 index 000000000..3854d261b --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample/where.go @@ -0,0 +1,482 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package directiveexample + +import ( + "entgo.io/contrib/entgql/internal/todo/ent/predicate" + "entgo.io/ent/dialect/sql" +) + +// ID filters vertices based on their ID field. +func ID(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id int) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldID, id)) +} + +// OnTypeField applies equality check predicate on the "on_type_field" field. It's identical to OnTypeFieldEQ. +func OnTypeField(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnTypeField, v)) +} + +// OnMutationFields applies equality check predicate on the "on_mutation_fields" field. It's identical to OnMutationFieldsEQ. +func OnMutationFields(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationFields, v)) +} + +// OnMutationCreate applies equality check predicate on the "on_mutation_create" field. It's identical to OnMutationCreateEQ. +func OnMutationCreate(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationCreate, v)) +} + +// OnMutationUpdate applies equality check predicate on the "on_mutation_update" field. It's identical to OnMutationUpdateEQ. +func OnMutationUpdate(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationUpdate, v)) +} + +// OnAllFields applies equality check predicate on the "on_all_fields" field. It's identical to OnAllFieldsEQ. +func OnAllFields(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnAllFields, v)) +} + +// OnTypeFieldEQ applies the EQ predicate on the "on_type_field" field. +func OnTypeFieldEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnTypeField, v)) +} + +// OnTypeFieldNEQ applies the NEQ predicate on the "on_type_field" field. +func OnTypeFieldNEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldOnTypeField, v)) +} + +// OnTypeFieldIn applies the In predicate on the "on_type_field" field. +func OnTypeFieldIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldOnTypeField, vs...)) +} + +// OnTypeFieldNotIn applies the NotIn predicate on the "on_type_field" field. +func OnTypeFieldNotIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldOnTypeField, vs...)) +} + +// OnTypeFieldGT applies the GT predicate on the "on_type_field" field. +func OnTypeFieldGT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldOnTypeField, v)) +} + +// OnTypeFieldGTE applies the GTE predicate on the "on_type_field" field. +func OnTypeFieldGTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldOnTypeField, v)) +} + +// OnTypeFieldLT applies the LT predicate on the "on_type_field" field. +func OnTypeFieldLT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldOnTypeField, v)) +} + +// OnTypeFieldLTE applies the LTE predicate on the "on_type_field" field. +func OnTypeFieldLTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldOnTypeField, v)) +} + +// OnTypeFieldContains applies the Contains predicate on the "on_type_field" field. +func OnTypeFieldContains(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContains(FieldOnTypeField, v)) +} + +// OnTypeFieldHasPrefix applies the HasPrefix predicate on the "on_type_field" field. +func OnTypeFieldHasPrefix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasPrefix(FieldOnTypeField, v)) +} + +// OnTypeFieldHasSuffix applies the HasSuffix predicate on the "on_type_field" field. +func OnTypeFieldHasSuffix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasSuffix(FieldOnTypeField, v)) +} + +// OnTypeFieldIsNil applies the IsNil predicate on the "on_type_field" field. +func OnTypeFieldIsNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIsNull(FieldOnTypeField)) +} + +// OnTypeFieldNotNil applies the NotNil predicate on the "on_type_field" field. +func OnTypeFieldNotNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotNull(FieldOnTypeField)) +} + +// OnTypeFieldEqualFold applies the EqualFold predicate on the "on_type_field" field. +func OnTypeFieldEqualFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEqualFold(FieldOnTypeField, v)) +} + +// OnTypeFieldContainsFold applies the ContainsFold predicate on the "on_type_field" field. +func OnTypeFieldContainsFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContainsFold(FieldOnTypeField, v)) +} + +// OnMutationFieldsEQ applies the EQ predicate on the "on_mutation_fields" field. +func OnMutationFieldsEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationFields, v)) +} + +// OnMutationFieldsNEQ applies the NEQ predicate on the "on_mutation_fields" field. +func OnMutationFieldsNEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldOnMutationFields, v)) +} + +// OnMutationFieldsIn applies the In predicate on the "on_mutation_fields" field. +func OnMutationFieldsIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldOnMutationFields, vs...)) +} + +// OnMutationFieldsNotIn applies the NotIn predicate on the "on_mutation_fields" field. +func OnMutationFieldsNotIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldOnMutationFields, vs...)) +} + +// OnMutationFieldsGT applies the GT predicate on the "on_mutation_fields" field. +func OnMutationFieldsGT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldOnMutationFields, v)) +} + +// OnMutationFieldsGTE applies the GTE predicate on the "on_mutation_fields" field. +func OnMutationFieldsGTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldOnMutationFields, v)) +} + +// OnMutationFieldsLT applies the LT predicate on the "on_mutation_fields" field. +func OnMutationFieldsLT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldOnMutationFields, v)) +} + +// OnMutationFieldsLTE applies the LTE predicate on the "on_mutation_fields" field. +func OnMutationFieldsLTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldOnMutationFields, v)) +} + +// OnMutationFieldsContains applies the Contains predicate on the "on_mutation_fields" field. +func OnMutationFieldsContains(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContains(FieldOnMutationFields, v)) +} + +// OnMutationFieldsHasPrefix applies the HasPrefix predicate on the "on_mutation_fields" field. +func OnMutationFieldsHasPrefix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasPrefix(FieldOnMutationFields, v)) +} + +// OnMutationFieldsHasSuffix applies the HasSuffix predicate on the "on_mutation_fields" field. +func OnMutationFieldsHasSuffix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasSuffix(FieldOnMutationFields, v)) +} + +// OnMutationFieldsIsNil applies the IsNil predicate on the "on_mutation_fields" field. +func OnMutationFieldsIsNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIsNull(FieldOnMutationFields)) +} + +// OnMutationFieldsNotNil applies the NotNil predicate on the "on_mutation_fields" field. +func OnMutationFieldsNotNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotNull(FieldOnMutationFields)) +} + +// OnMutationFieldsEqualFold applies the EqualFold predicate on the "on_mutation_fields" field. +func OnMutationFieldsEqualFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEqualFold(FieldOnMutationFields, v)) +} + +// OnMutationFieldsContainsFold applies the ContainsFold predicate on the "on_mutation_fields" field. +func OnMutationFieldsContainsFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContainsFold(FieldOnMutationFields, v)) +} + +// OnMutationCreateEQ applies the EQ predicate on the "on_mutation_create" field. +func OnMutationCreateEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationCreate, v)) +} + +// OnMutationCreateNEQ applies the NEQ predicate on the "on_mutation_create" field. +func OnMutationCreateNEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldOnMutationCreate, v)) +} + +// OnMutationCreateIn applies the In predicate on the "on_mutation_create" field. +func OnMutationCreateIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldOnMutationCreate, vs...)) +} + +// OnMutationCreateNotIn applies the NotIn predicate on the "on_mutation_create" field. +func OnMutationCreateNotIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldOnMutationCreate, vs...)) +} + +// OnMutationCreateGT applies the GT predicate on the "on_mutation_create" field. +func OnMutationCreateGT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldOnMutationCreate, v)) +} + +// OnMutationCreateGTE applies the GTE predicate on the "on_mutation_create" field. +func OnMutationCreateGTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldOnMutationCreate, v)) +} + +// OnMutationCreateLT applies the LT predicate on the "on_mutation_create" field. +func OnMutationCreateLT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldOnMutationCreate, v)) +} + +// OnMutationCreateLTE applies the LTE predicate on the "on_mutation_create" field. +func OnMutationCreateLTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldOnMutationCreate, v)) +} + +// OnMutationCreateContains applies the Contains predicate on the "on_mutation_create" field. +func OnMutationCreateContains(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContains(FieldOnMutationCreate, v)) +} + +// OnMutationCreateHasPrefix applies the HasPrefix predicate on the "on_mutation_create" field. +func OnMutationCreateHasPrefix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasPrefix(FieldOnMutationCreate, v)) +} + +// OnMutationCreateHasSuffix applies the HasSuffix predicate on the "on_mutation_create" field. +func OnMutationCreateHasSuffix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasSuffix(FieldOnMutationCreate, v)) +} + +// OnMutationCreateIsNil applies the IsNil predicate on the "on_mutation_create" field. +func OnMutationCreateIsNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIsNull(FieldOnMutationCreate)) +} + +// OnMutationCreateNotNil applies the NotNil predicate on the "on_mutation_create" field. +func OnMutationCreateNotNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotNull(FieldOnMutationCreate)) +} + +// OnMutationCreateEqualFold applies the EqualFold predicate on the "on_mutation_create" field. +func OnMutationCreateEqualFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEqualFold(FieldOnMutationCreate, v)) +} + +// OnMutationCreateContainsFold applies the ContainsFold predicate on the "on_mutation_create" field. +func OnMutationCreateContainsFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContainsFold(FieldOnMutationCreate, v)) +} + +// OnMutationUpdateEQ applies the EQ predicate on the "on_mutation_update" field. +func OnMutationUpdateEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateNEQ applies the NEQ predicate on the "on_mutation_update" field. +func OnMutationUpdateNEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateIn applies the In predicate on the "on_mutation_update" field. +func OnMutationUpdateIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldOnMutationUpdate, vs...)) +} + +// OnMutationUpdateNotIn applies the NotIn predicate on the "on_mutation_update" field. +func OnMutationUpdateNotIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldOnMutationUpdate, vs...)) +} + +// OnMutationUpdateGT applies the GT predicate on the "on_mutation_update" field. +func OnMutationUpdateGT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateGTE applies the GTE predicate on the "on_mutation_update" field. +func OnMutationUpdateGTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateLT applies the LT predicate on the "on_mutation_update" field. +func OnMutationUpdateLT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateLTE applies the LTE predicate on the "on_mutation_update" field. +func OnMutationUpdateLTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateContains applies the Contains predicate on the "on_mutation_update" field. +func OnMutationUpdateContains(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContains(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateHasPrefix applies the HasPrefix predicate on the "on_mutation_update" field. +func OnMutationUpdateHasPrefix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasPrefix(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateHasSuffix applies the HasSuffix predicate on the "on_mutation_update" field. +func OnMutationUpdateHasSuffix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasSuffix(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateIsNil applies the IsNil predicate on the "on_mutation_update" field. +func OnMutationUpdateIsNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIsNull(FieldOnMutationUpdate)) +} + +// OnMutationUpdateNotNil applies the NotNil predicate on the "on_mutation_update" field. +func OnMutationUpdateNotNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotNull(FieldOnMutationUpdate)) +} + +// OnMutationUpdateEqualFold applies the EqualFold predicate on the "on_mutation_update" field. +func OnMutationUpdateEqualFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEqualFold(FieldOnMutationUpdate, v)) +} + +// OnMutationUpdateContainsFold applies the ContainsFold predicate on the "on_mutation_update" field. +func OnMutationUpdateContainsFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContainsFold(FieldOnMutationUpdate, v)) +} + +// OnAllFieldsEQ applies the EQ predicate on the "on_all_fields" field. +func OnAllFieldsEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEQ(FieldOnAllFields, v)) +} + +// OnAllFieldsNEQ applies the NEQ predicate on the "on_all_fields" field. +func OnAllFieldsNEQ(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNEQ(FieldOnAllFields, v)) +} + +// OnAllFieldsIn applies the In predicate on the "on_all_fields" field. +func OnAllFieldsIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIn(FieldOnAllFields, vs...)) +} + +// OnAllFieldsNotIn applies the NotIn predicate on the "on_all_fields" field. +func OnAllFieldsNotIn(vs ...string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotIn(FieldOnAllFields, vs...)) +} + +// OnAllFieldsGT applies the GT predicate on the "on_all_fields" field. +func OnAllFieldsGT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGT(FieldOnAllFields, v)) +} + +// OnAllFieldsGTE applies the GTE predicate on the "on_all_fields" field. +func OnAllFieldsGTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldGTE(FieldOnAllFields, v)) +} + +// OnAllFieldsLT applies the LT predicate on the "on_all_fields" field. +func OnAllFieldsLT(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLT(FieldOnAllFields, v)) +} + +// OnAllFieldsLTE applies the LTE predicate on the "on_all_fields" field. +func OnAllFieldsLTE(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldLTE(FieldOnAllFields, v)) +} + +// OnAllFieldsContains applies the Contains predicate on the "on_all_fields" field. +func OnAllFieldsContains(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContains(FieldOnAllFields, v)) +} + +// OnAllFieldsHasPrefix applies the HasPrefix predicate on the "on_all_fields" field. +func OnAllFieldsHasPrefix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasPrefix(FieldOnAllFields, v)) +} + +// OnAllFieldsHasSuffix applies the HasSuffix predicate on the "on_all_fields" field. +func OnAllFieldsHasSuffix(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldHasSuffix(FieldOnAllFields, v)) +} + +// OnAllFieldsIsNil applies the IsNil predicate on the "on_all_fields" field. +func OnAllFieldsIsNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldIsNull(FieldOnAllFields)) +} + +// OnAllFieldsNotNil applies the NotNil predicate on the "on_all_fields" field. +func OnAllFieldsNotNil() predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldNotNull(FieldOnAllFields)) +} + +// OnAllFieldsEqualFold applies the EqualFold predicate on the "on_all_fields" field. +func OnAllFieldsEqualFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldEqualFold(FieldOnAllFields, v)) +} + +// OnAllFieldsContainsFold applies the ContainsFold predicate on the "on_all_fields" field. +func OnAllFieldsContainsFold(v string) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.FieldContainsFold(FieldOnAllFields, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.DirectiveExample) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.DirectiveExample) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.DirectiveExample) predicate.DirectiveExample { + return predicate.DirectiveExample(sql.NotPredicates(p)) +} diff --git a/entgql/internal/todo/ent/directiveexample_create.go b/entgql/internal/todo/ent/directiveexample_create.go new file mode 100644 index 000000000..a3079df4e --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample_create.go @@ -0,0 +1,273 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DirectiveExampleCreate is the builder for creating a DirectiveExample entity. +type DirectiveExampleCreate struct { + config + mutation *DirectiveExampleMutation + hooks []Hook +} + +// SetOnTypeField sets the "on_type_field" field. +func (dec *DirectiveExampleCreate) SetOnTypeField(s string) *DirectiveExampleCreate { + dec.mutation.SetOnTypeField(s) + return dec +} + +// SetNillableOnTypeField sets the "on_type_field" field if the given value is not nil. +func (dec *DirectiveExampleCreate) SetNillableOnTypeField(s *string) *DirectiveExampleCreate { + if s != nil { + dec.SetOnTypeField(*s) + } + return dec +} + +// SetOnMutationFields sets the "on_mutation_fields" field. +func (dec *DirectiveExampleCreate) SetOnMutationFields(s string) *DirectiveExampleCreate { + dec.mutation.SetOnMutationFields(s) + return dec +} + +// SetNillableOnMutationFields sets the "on_mutation_fields" field if the given value is not nil. +func (dec *DirectiveExampleCreate) SetNillableOnMutationFields(s *string) *DirectiveExampleCreate { + if s != nil { + dec.SetOnMutationFields(*s) + } + return dec +} + +// SetOnMutationCreate sets the "on_mutation_create" field. +func (dec *DirectiveExampleCreate) SetOnMutationCreate(s string) *DirectiveExampleCreate { + dec.mutation.SetOnMutationCreate(s) + return dec +} + +// SetNillableOnMutationCreate sets the "on_mutation_create" field if the given value is not nil. +func (dec *DirectiveExampleCreate) SetNillableOnMutationCreate(s *string) *DirectiveExampleCreate { + if s != nil { + dec.SetOnMutationCreate(*s) + } + return dec +} + +// SetOnMutationUpdate sets the "on_mutation_update" field. +func (dec *DirectiveExampleCreate) SetOnMutationUpdate(s string) *DirectiveExampleCreate { + dec.mutation.SetOnMutationUpdate(s) + return dec +} + +// SetNillableOnMutationUpdate sets the "on_mutation_update" field if the given value is not nil. +func (dec *DirectiveExampleCreate) SetNillableOnMutationUpdate(s *string) *DirectiveExampleCreate { + if s != nil { + dec.SetOnMutationUpdate(*s) + } + return dec +} + +// SetOnAllFields sets the "on_all_fields" field. +func (dec *DirectiveExampleCreate) SetOnAllFields(s string) *DirectiveExampleCreate { + dec.mutation.SetOnAllFields(s) + return dec +} + +// SetNillableOnAllFields sets the "on_all_fields" field if the given value is not nil. +func (dec *DirectiveExampleCreate) SetNillableOnAllFields(s *string) *DirectiveExampleCreate { + if s != nil { + dec.SetOnAllFields(*s) + } + return dec +} + +// Mutation returns the DirectiveExampleMutation object of the builder. +func (dec *DirectiveExampleCreate) Mutation() *DirectiveExampleMutation { + return dec.mutation +} + +// Save creates the DirectiveExample in the database. +func (dec *DirectiveExampleCreate) Save(ctx context.Context) (*DirectiveExample, error) { + return withHooks(ctx, dec.sqlSave, dec.mutation, dec.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (dec *DirectiveExampleCreate) SaveX(ctx context.Context) *DirectiveExample { + v, err := dec.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (dec *DirectiveExampleCreate) Exec(ctx context.Context) error { + _, err := dec.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (dec *DirectiveExampleCreate) ExecX(ctx context.Context) { + if err := dec.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (dec *DirectiveExampleCreate) check() error { + return nil +} + +func (dec *DirectiveExampleCreate) sqlSave(ctx context.Context) (*DirectiveExample, error) { + if err := dec.check(); err != nil { + return nil, err + } + _node, _spec := dec.createSpec() + if err := sqlgraph.CreateNode(ctx, dec.driver, _spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + id := _spec.ID.Value.(int64) + _node.ID = int(id) + dec.mutation.id = &_node.ID + dec.mutation.done = true + return _node, nil +} + +func (dec *DirectiveExampleCreate) createSpec() (*DirectiveExample, *sqlgraph.CreateSpec) { + var ( + _node = &DirectiveExample{config: dec.config} + _spec = sqlgraph.NewCreateSpec(directiveexample.Table, sqlgraph.NewFieldSpec(directiveexample.FieldID, field.TypeInt)) + ) + if value, ok := dec.mutation.OnTypeField(); ok { + _spec.SetField(directiveexample.FieldOnTypeField, field.TypeString, value) + _node.OnTypeField = value + } + if value, ok := dec.mutation.OnMutationFields(); ok { + _spec.SetField(directiveexample.FieldOnMutationFields, field.TypeString, value) + _node.OnMutationFields = value + } + if value, ok := dec.mutation.OnMutationCreate(); ok { + _spec.SetField(directiveexample.FieldOnMutationCreate, field.TypeString, value) + _node.OnMutationCreate = value + } + if value, ok := dec.mutation.OnMutationUpdate(); ok { + _spec.SetField(directiveexample.FieldOnMutationUpdate, field.TypeString, value) + _node.OnMutationUpdate = value + } + if value, ok := dec.mutation.OnAllFields(); ok { + _spec.SetField(directiveexample.FieldOnAllFields, field.TypeString, value) + _node.OnAllFields = value + } + return _node, _spec +} + +// DirectiveExampleCreateBulk is the builder for creating many DirectiveExample entities in bulk. +type DirectiveExampleCreateBulk struct { + config + err error + builders []*DirectiveExampleCreate +} + +// Save creates the DirectiveExample entities in the database. +func (decb *DirectiveExampleCreateBulk) Save(ctx context.Context) ([]*DirectiveExample, error) { + if decb.err != nil { + return nil, decb.err + } + specs := make([]*sqlgraph.CreateSpec, len(decb.builders)) + nodes := make([]*DirectiveExample, len(decb.builders)) + mutators := make([]Mutator, len(decb.builders)) + for i := range decb.builders { + func(i int, root context.Context) { + builder := decb.builders[i] + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*DirectiveExampleMutation) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + if err := builder.check(); err != nil { + return nil, err + } + builder.mutation = mutation + var err error + nodes[i], specs[i] = builder.createSpec() + if i < len(mutators)-1 { + _, err = mutators[i+1].Mutate(root, decb.builders[i+1].mutation) + } else { + spec := &sqlgraph.BatchCreateSpec{Nodes: specs} + // Invoke the actual operation on the latest mutation in the chain. + if err = sqlgraph.BatchCreate(ctx, decb.driver, spec); err != nil { + if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + } + } + if err != nil { + return nil, err + } + mutation.id = &nodes[i].ID + if specs[i].ID.Value != nil { + id := specs[i].ID.Value.(int64) + nodes[i].ID = int(id) + } + mutation.done = true + return nodes[i], nil + }) + for i := len(builder.hooks) - 1; i >= 0; i-- { + mut = builder.hooks[i](mut) + } + mutators[i] = mut + }(i, ctx) + } + if len(mutators) > 0 { + if _, err := mutators[0].Mutate(ctx, decb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (decb *DirectiveExampleCreateBulk) SaveX(ctx context.Context) []*DirectiveExample { + v, err := decb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (decb *DirectiveExampleCreateBulk) Exec(ctx context.Context) error { + _, err := decb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (decb *DirectiveExampleCreateBulk) ExecX(ctx context.Context) { + if err := decb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/entgql/internal/todo/ent/directiveexample_delete.go b/entgql/internal/todo/ent/directiveexample_delete.go new file mode 100644 index 000000000..5ac5ef7d3 --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample_delete.go @@ -0,0 +1,102 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package ent + +import ( + "context" + + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" + "entgo.io/contrib/entgql/internal/todo/ent/predicate" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DirectiveExampleDelete is the builder for deleting a DirectiveExample entity. +type DirectiveExampleDelete struct { + config + hooks []Hook + mutation *DirectiveExampleMutation +} + +// Where appends a list predicates to the DirectiveExampleDelete builder. +func (ded *DirectiveExampleDelete) Where(ps ...predicate.DirectiveExample) *DirectiveExampleDelete { + ded.mutation.Where(ps...) + return ded +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ded *DirectiveExampleDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ded.sqlExec, ded.mutation, ded.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ded *DirectiveExampleDelete) ExecX(ctx context.Context) int { + n, err := ded.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ded *DirectiveExampleDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(directiveexample.Table, sqlgraph.NewFieldSpec(directiveexample.FieldID, field.TypeInt)) + if ps := ded.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ded.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ded.mutation.done = true + return affected, err +} + +// DirectiveExampleDeleteOne is the builder for deleting a single DirectiveExample entity. +type DirectiveExampleDeleteOne struct { + ded *DirectiveExampleDelete +} + +// Where appends a list predicates to the DirectiveExampleDelete builder. +func (dedo *DirectiveExampleDeleteOne) Where(ps ...predicate.DirectiveExample) *DirectiveExampleDeleteOne { + dedo.ded.mutation.Where(ps...) + return dedo +} + +// Exec executes the deletion query. +func (dedo *DirectiveExampleDeleteOne) Exec(ctx context.Context) error { + n, err := dedo.ded.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{directiveexample.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (dedo *DirectiveExampleDeleteOne) ExecX(ctx context.Context) { + if err := dedo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/entgql/internal/todo/ent/directiveexample_query.go b/entgql/internal/todo/ent/directiveexample_query.go new file mode 100644 index 000000000..45ab0e3db --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample_query.go @@ -0,0 +1,570 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package ent + +import ( + "context" + "fmt" + "math" + + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" + "entgo.io/contrib/entgql/internal/todo/ent/predicate" + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DirectiveExampleQuery is the builder for querying DirectiveExample entities. +type DirectiveExampleQuery struct { + config + ctx *QueryContext + order []directiveexample.OrderOption + inters []Interceptor + predicates []predicate.DirectiveExample + loadTotal []func(context.Context, []*DirectiveExample) error + modifiers []func(*sql.Selector) + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the DirectiveExampleQuery builder. +func (deq *DirectiveExampleQuery) Where(ps ...predicate.DirectiveExample) *DirectiveExampleQuery { + deq.predicates = append(deq.predicates, ps...) + return deq +} + +// Limit the number of records to be returned by this query. +func (deq *DirectiveExampleQuery) Limit(limit int) *DirectiveExampleQuery { + deq.ctx.Limit = &limit + return deq +} + +// Offset to start from. +func (deq *DirectiveExampleQuery) Offset(offset int) *DirectiveExampleQuery { + deq.ctx.Offset = &offset + return deq +} + +// Unique configures the query builder to filter duplicate records on query. +// By default, unique is set to true, and can be disabled using this method. +func (deq *DirectiveExampleQuery) Unique(unique bool) *DirectiveExampleQuery { + deq.ctx.Unique = &unique + return deq +} + +// Order specifies how the records should be ordered. +func (deq *DirectiveExampleQuery) Order(o ...directiveexample.OrderOption) *DirectiveExampleQuery { + deq.order = append(deq.order, o...) + return deq +} + +// First returns the first DirectiveExample entity from the query. +// Returns a *NotFoundError when no DirectiveExample was found. +func (deq *DirectiveExampleQuery) First(ctx context.Context) (*DirectiveExample, error) { + nodes, err := deq.Limit(1).All(setContextOp(ctx, deq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{directiveexample.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (deq *DirectiveExampleQuery) FirstX(ctx context.Context) *DirectiveExample { + node, err := deq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first DirectiveExample ID from the query. +// Returns a *NotFoundError when no DirectiveExample ID was found. +func (deq *DirectiveExampleQuery) FirstID(ctx context.Context) (id int, err error) { + var ids []int + if ids, err = deq.Limit(1).IDs(setContextOp(ctx, deq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{directiveexample.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (deq *DirectiveExampleQuery) FirstIDX(ctx context.Context) int { + id, err := deq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single DirectiveExample entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one DirectiveExample entity is found. +// Returns a *NotFoundError when no DirectiveExample entities are found. +func (deq *DirectiveExampleQuery) Only(ctx context.Context) (*DirectiveExample, error) { + nodes, err := deq.Limit(2).All(setContextOp(ctx, deq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{directiveexample.Label} + default: + return nil, &NotSingularError{directiveexample.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (deq *DirectiveExampleQuery) OnlyX(ctx context.Context) *DirectiveExample { + node, err := deq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only DirectiveExample ID in the query. +// Returns a *NotSingularError when more than one DirectiveExample ID is found. +// Returns a *NotFoundError when no entities are found. +func (deq *DirectiveExampleQuery) OnlyID(ctx context.Context) (id int, err error) { + var ids []int + if ids, err = deq.Limit(2).IDs(setContextOp(ctx, deq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{directiveexample.Label} + default: + err = &NotSingularError{directiveexample.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (deq *DirectiveExampleQuery) OnlyIDX(ctx context.Context) int { + id, err := deq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of DirectiveExamples. +func (deq *DirectiveExampleQuery) All(ctx context.Context) ([]*DirectiveExample, error) { + ctx = setContextOp(ctx, deq.ctx, ent.OpQueryAll) + if err := deq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*DirectiveExample, *DirectiveExampleQuery]() + return withInterceptors[[]*DirectiveExample](ctx, deq, qr, deq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (deq *DirectiveExampleQuery) AllX(ctx context.Context) []*DirectiveExample { + nodes, err := deq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of DirectiveExample IDs. +func (deq *DirectiveExampleQuery) IDs(ctx context.Context) (ids []int, err error) { + if deq.ctx.Unique == nil && deq.path != nil { + deq.Unique(true) + } + ctx = setContextOp(ctx, deq.ctx, ent.OpQueryIDs) + if err = deq.Select(directiveexample.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (deq *DirectiveExampleQuery) IDsX(ctx context.Context) []int { + ids, err := deq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (deq *DirectiveExampleQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, deq.ctx, ent.OpQueryCount) + if err := deq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, deq, querierCount[*DirectiveExampleQuery](), deq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (deq *DirectiveExampleQuery) CountX(ctx context.Context) int { + count, err := deq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (deq *DirectiveExampleQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, deq.ctx, ent.OpQueryExist) + switch _, err := deq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("ent: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (deq *DirectiveExampleQuery) ExistX(ctx context.Context) bool { + exist, err := deq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the DirectiveExampleQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (deq *DirectiveExampleQuery) Clone() *DirectiveExampleQuery { + if deq == nil { + return nil + } + return &DirectiveExampleQuery{ + config: deq.config, + ctx: deq.ctx.Clone(), + order: append([]directiveexample.OrderOption{}, deq.order...), + inters: append([]Interceptor{}, deq.inters...), + predicates: append([]predicate.DirectiveExample{}, deq.predicates...), + // clone intermediate query. + sql: deq.sql.Clone(), + path: deq.path, + modifiers: append([]func(*sql.Selector){}, deq.modifiers...), + } +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// OnTypeField string `json:"on_type_field,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.DirectiveExample.Query(). +// GroupBy(directiveexample.FieldOnTypeField). +// Aggregate(ent.Count()). +// Scan(ctx, &v) +func (deq *DirectiveExampleQuery) GroupBy(field string, fields ...string) *DirectiveExampleGroupBy { + deq.ctx.Fields = append([]string{field}, fields...) + grbuild := &DirectiveExampleGroupBy{build: deq} + grbuild.flds = &deq.ctx.Fields + grbuild.label = directiveexample.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// OnTypeField string `json:"on_type_field,omitempty"` +// } +// +// client.DirectiveExample.Query(). +// Select(directiveexample.FieldOnTypeField). +// Scan(ctx, &v) +func (deq *DirectiveExampleQuery) Select(fields ...string) *DirectiveExampleSelect { + deq.ctx.Fields = append(deq.ctx.Fields, fields...) + sbuild := &DirectiveExampleSelect{DirectiveExampleQuery: deq} + sbuild.label = directiveexample.Label + sbuild.flds, sbuild.scan = &deq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a DirectiveExampleSelect configured with the given aggregations. +func (deq *DirectiveExampleQuery) Aggregate(fns ...AggregateFunc) *DirectiveExampleSelect { + return deq.Select().Aggregate(fns...) +} + +func (deq *DirectiveExampleQuery) prepareQuery(ctx context.Context) error { + for _, inter := range deq.inters { + if inter == nil { + return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, deq); err != nil { + return err + } + } + } + for _, f := range deq.ctx.Fields { + if !directiveexample.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + } + if deq.path != nil { + prev, err := deq.path(ctx) + if err != nil { + return err + } + deq.sql = prev + } + return nil +} + +func (deq *DirectiveExampleQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*DirectiveExample, error) { + var ( + nodes = []*DirectiveExample{} + _spec = deq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*DirectiveExample).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &DirectiveExample{config: deq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + if len(deq.modifiers) > 0 { + _spec.Modifiers = deq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, deq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range deq.loadTotal { + if err := deq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (deq *DirectiveExampleQuery) sqlCount(ctx context.Context) (int, error) { + _spec := deq.querySpec() + if len(deq.modifiers) > 0 { + _spec.Modifiers = deq.modifiers + } + _spec.Node.Columns = deq.ctx.Fields + if len(deq.ctx.Fields) > 0 { + _spec.Unique = deq.ctx.Unique != nil && *deq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, deq.driver, _spec) +} + +func (deq *DirectiveExampleQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(directiveexample.Table, directiveexample.Columns, sqlgraph.NewFieldSpec(directiveexample.FieldID, field.TypeInt)) + _spec.From = deq.sql + if unique := deq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if deq.path != nil { + _spec.Unique = true + } + if fields := deq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, directiveexample.FieldID) + for i := range fields { + if fields[i] != directiveexample.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := deq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := deq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := deq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := deq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (deq *DirectiveExampleQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(deq.driver.Dialect()) + t1 := builder.Table(directiveexample.Table) + columns := deq.ctx.Fields + if len(columns) == 0 { + columns = directiveexample.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if deq.sql != nil { + selector = deq.sql + selector.Select(selector.Columns(columns...)...) + } + if deq.ctx.Unique != nil && *deq.ctx.Unique { + selector.Distinct() + } + for _, m := range deq.modifiers { + m(selector) + } + for _, p := range deq.predicates { + p(selector) + } + for _, p := range deq.order { + p(selector) + } + if offset := deq.ctx.Offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt32) + } + if limit := deq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (deq *DirectiveExampleQuery) Modify(modifiers ...func(s *sql.Selector)) *DirectiveExampleSelect { + deq.modifiers = append(deq.modifiers, modifiers...) + return deq.Select() +} + +// DirectiveExampleGroupBy is the group-by builder for DirectiveExample entities. +type DirectiveExampleGroupBy struct { + selector + build *DirectiveExampleQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (degb *DirectiveExampleGroupBy) Aggregate(fns ...AggregateFunc) *DirectiveExampleGroupBy { + degb.fns = append(degb.fns, fns...) + return degb +} + +// Scan applies the selector query and scans the result into the given value. +func (degb *DirectiveExampleGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, degb.build.ctx, ent.OpQueryGroupBy) + if err := degb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DirectiveExampleQuery, *DirectiveExampleGroupBy](ctx, degb.build, degb, degb.build.inters, v) +} + +func (degb *DirectiveExampleGroupBy) sqlScan(ctx context.Context, root *DirectiveExampleQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(degb.fns)) + for _, fn := range degb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*degb.flds)+len(degb.fns)) + for _, f := range *degb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*degb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := degb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// DirectiveExampleSelect is the builder for selecting fields of DirectiveExample entities. +type DirectiveExampleSelect struct { + *DirectiveExampleQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (des *DirectiveExampleSelect) Aggregate(fns ...AggregateFunc) *DirectiveExampleSelect { + des.fns = append(des.fns, fns...) + return des +} + +// Scan applies the selector query and scans the result into the given value. +func (des *DirectiveExampleSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, des.ctx, ent.OpQuerySelect) + if err := des.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DirectiveExampleQuery, *DirectiveExampleSelect](ctx, des.DirectiveExampleQuery, des, des.inters, v) +} + +func (des *DirectiveExampleSelect) sqlScan(ctx context.Context, root *DirectiveExampleQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(des.fns)) + for _, fn := range des.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*des.selector.flds); { + case n == 0 && len(aggregation) > 0: + selector.Select(aggregation...) + case n != 0 && len(aggregation) > 0: + selector.AppendSelect(aggregation...) + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := des.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// Modify adds a query modifier for attaching custom logic to queries. +func (des *DirectiveExampleSelect) Modify(modifiers ...func(s *sql.Selector)) *DirectiveExampleSelect { + des.modifiers = append(des.modifiers, modifiers...) + return des +} diff --git a/entgql/internal/todo/ent/directiveexample_update.go b/entgql/internal/todo/ent/directiveexample_update.go new file mode 100644 index 000000000..e62e6ac2d --- /dev/null +++ b/entgql/internal/todo/ent/directiveexample_update.go @@ -0,0 +1,465 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by entc, DO NOT EDIT. + +package ent + +import ( + "context" + "errors" + "fmt" + + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" + "entgo.io/contrib/entgql/internal/todo/ent/predicate" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" +) + +// DirectiveExampleUpdate is the builder for updating DirectiveExample entities. +type DirectiveExampleUpdate struct { + config + hooks []Hook + mutation *DirectiveExampleMutation + modifiers []func(*sql.UpdateBuilder) +} + +// Where appends a list predicates to the DirectiveExampleUpdate builder. +func (deu *DirectiveExampleUpdate) Where(ps ...predicate.DirectiveExample) *DirectiveExampleUpdate { + deu.mutation.Where(ps...) + return deu +} + +// SetOnTypeField sets the "on_type_field" field. +func (deu *DirectiveExampleUpdate) SetOnTypeField(s string) *DirectiveExampleUpdate { + deu.mutation.SetOnTypeField(s) + return deu +} + +// SetNillableOnTypeField sets the "on_type_field" field if the given value is not nil. +func (deu *DirectiveExampleUpdate) SetNillableOnTypeField(s *string) *DirectiveExampleUpdate { + if s != nil { + deu.SetOnTypeField(*s) + } + return deu +} + +// ClearOnTypeField clears the value of the "on_type_field" field. +func (deu *DirectiveExampleUpdate) ClearOnTypeField() *DirectiveExampleUpdate { + deu.mutation.ClearOnTypeField() + return deu +} + +// SetOnMutationFields sets the "on_mutation_fields" field. +func (deu *DirectiveExampleUpdate) SetOnMutationFields(s string) *DirectiveExampleUpdate { + deu.mutation.SetOnMutationFields(s) + return deu +} + +// SetNillableOnMutationFields sets the "on_mutation_fields" field if the given value is not nil. +func (deu *DirectiveExampleUpdate) SetNillableOnMutationFields(s *string) *DirectiveExampleUpdate { + if s != nil { + deu.SetOnMutationFields(*s) + } + return deu +} + +// ClearOnMutationFields clears the value of the "on_mutation_fields" field. +func (deu *DirectiveExampleUpdate) ClearOnMutationFields() *DirectiveExampleUpdate { + deu.mutation.ClearOnMutationFields() + return deu +} + +// SetOnMutationCreate sets the "on_mutation_create" field. +func (deu *DirectiveExampleUpdate) SetOnMutationCreate(s string) *DirectiveExampleUpdate { + deu.mutation.SetOnMutationCreate(s) + return deu +} + +// SetNillableOnMutationCreate sets the "on_mutation_create" field if the given value is not nil. +func (deu *DirectiveExampleUpdate) SetNillableOnMutationCreate(s *string) *DirectiveExampleUpdate { + if s != nil { + deu.SetOnMutationCreate(*s) + } + return deu +} + +// ClearOnMutationCreate clears the value of the "on_mutation_create" field. +func (deu *DirectiveExampleUpdate) ClearOnMutationCreate() *DirectiveExampleUpdate { + deu.mutation.ClearOnMutationCreate() + return deu +} + +// SetOnMutationUpdate sets the "on_mutation_update" field. +func (deu *DirectiveExampleUpdate) SetOnMutationUpdate(s string) *DirectiveExampleUpdate { + deu.mutation.SetOnMutationUpdate(s) + return deu +} + +// SetNillableOnMutationUpdate sets the "on_mutation_update" field if the given value is not nil. +func (deu *DirectiveExampleUpdate) SetNillableOnMutationUpdate(s *string) *DirectiveExampleUpdate { + if s != nil { + deu.SetOnMutationUpdate(*s) + } + return deu +} + +// ClearOnMutationUpdate clears the value of the "on_mutation_update" field. +func (deu *DirectiveExampleUpdate) ClearOnMutationUpdate() *DirectiveExampleUpdate { + deu.mutation.ClearOnMutationUpdate() + return deu +} + +// SetOnAllFields sets the "on_all_fields" field. +func (deu *DirectiveExampleUpdate) SetOnAllFields(s string) *DirectiveExampleUpdate { + deu.mutation.SetOnAllFields(s) + return deu +} + +// SetNillableOnAllFields sets the "on_all_fields" field if the given value is not nil. +func (deu *DirectiveExampleUpdate) SetNillableOnAllFields(s *string) *DirectiveExampleUpdate { + if s != nil { + deu.SetOnAllFields(*s) + } + return deu +} + +// ClearOnAllFields clears the value of the "on_all_fields" field. +func (deu *DirectiveExampleUpdate) ClearOnAllFields() *DirectiveExampleUpdate { + deu.mutation.ClearOnAllFields() + return deu +} + +// Mutation returns the DirectiveExampleMutation object of the builder. +func (deu *DirectiveExampleUpdate) Mutation() *DirectiveExampleMutation { + return deu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (deu *DirectiveExampleUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, deu.sqlSave, deu.mutation, deu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (deu *DirectiveExampleUpdate) SaveX(ctx context.Context) int { + affected, err := deu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (deu *DirectiveExampleUpdate) Exec(ctx context.Context) error { + _, err := deu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (deu *DirectiveExampleUpdate) ExecX(ctx context.Context) { + if err := deu.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (deu *DirectiveExampleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DirectiveExampleUpdate { + deu.modifiers = append(deu.modifiers, modifiers...) + return deu +} + +func (deu *DirectiveExampleUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(directiveexample.Table, directiveexample.Columns, sqlgraph.NewFieldSpec(directiveexample.FieldID, field.TypeInt)) + if ps := deu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := deu.mutation.OnTypeField(); ok { + _spec.SetField(directiveexample.FieldOnTypeField, field.TypeString, value) + } + if deu.mutation.OnTypeFieldCleared() { + _spec.ClearField(directiveexample.FieldOnTypeField, field.TypeString) + } + if value, ok := deu.mutation.OnMutationFields(); ok { + _spec.SetField(directiveexample.FieldOnMutationFields, field.TypeString, value) + } + if deu.mutation.OnMutationFieldsCleared() { + _spec.ClearField(directiveexample.FieldOnMutationFields, field.TypeString) + } + if value, ok := deu.mutation.OnMutationCreate(); ok { + _spec.SetField(directiveexample.FieldOnMutationCreate, field.TypeString, value) + } + if deu.mutation.OnMutationCreateCleared() { + _spec.ClearField(directiveexample.FieldOnMutationCreate, field.TypeString) + } + if value, ok := deu.mutation.OnMutationUpdate(); ok { + _spec.SetField(directiveexample.FieldOnMutationUpdate, field.TypeString, value) + } + if deu.mutation.OnMutationUpdateCleared() { + _spec.ClearField(directiveexample.FieldOnMutationUpdate, field.TypeString) + } + if value, ok := deu.mutation.OnAllFields(); ok { + _spec.SetField(directiveexample.FieldOnAllFields, field.TypeString, value) + } + if deu.mutation.OnAllFieldsCleared() { + _spec.ClearField(directiveexample.FieldOnAllFields, field.TypeString) + } + _spec.AddModifiers(deu.modifiers...) + if n, err = sqlgraph.UpdateNodes(ctx, deu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{directiveexample.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + deu.mutation.done = true + return n, nil +} + +// DirectiveExampleUpdateOne is the builder for updating a single DirectiveExample entity. +type DirectiveExampleUpdateOne struct { + config + fields []string + hooks []Hook + mutation *DirectiveExampleMutation + modifiers []func(*sql.UpdateBuilder) +} + +// SetOnTypeField sets the "on_type_field" field. +func (deuo *DirectiveExampleUpdateOne) SetOnTypeField(s string) *DirectiveExampleUpdateOne { + deuo.mutation.SetOnTypeField(s) + return deuo +} + +// SetNillableOnTypeField sets the "on_type_field" field if the given value is not nil. +func (deuo *DirectiveExampleUpdateOne) SetNillableOnTypeField(s *string) *DirectiveExampleUpdateOne { + if s != nil { + deuo.SetOnTypeField(*s) + } + return deuo +} + +// ClearOnTypeField clears the value of the "on_type_field" field. +func (deuo *DirectiveExampleUpdateOne) ClearOnTypeField() *DirectiveExampleUpdateOne { + deuo.mutation.ClearOnTypeField() + return deuo +} + +// SetOnMutationFields sets the "on_mutation_fields" field. +func (deuo *DirectiveExampleUpdateOne) SetOnMutationFields(s string) *DirectiveExampleUpdateOne { + deuo.mutation.SetOnMutationFields(s) + return deuo +} + +// SetNillableOnMutationFields sets the "on_mutation_fields" field if the given value is not nil. +func (deuo *DirectiveExampleUpdateOne) SetNillableOnMutationFields(s *string) *DirectiveExampleUpdateOne { + if s != nil { + deuo.SetOnMutationFields(*s) + } + return deuo +} + +// ClearOnMutationFields clears the value of the "on_mutation_fields" field. +func (deuo *DirectiveExampleUpdateOne) ClearOnMutationFields() *DirectiveExampleUpdateOne { + deuo.mutation.ClearOnMutationFields() + return deuo +} + +// SetOnMutationCreate sets the "on_mutation_create" field. +func (deuo *DirectiveExampleUpdateOne) SetOnMutationCreate(s string) *DirectiveExampleUpdateOne { + deuo.mutation.SetOnMutationCreate(s) + return deuo +} + +// SetNillableOnMutationCreate sets the "on_mutation_create" field if the given value is not nil. +func (deuo *DirectiveExampleUpdateOne) SetNillableOnMutationCreate(s *string) *DirectiveExampleUpdateOne { + if s != nil { + deuo.SetOnMutationCreate(*s) + } + return deuo +} + +// ClearOnMutationCreate clears the value of the "on_mutation_create" field. +func (deuo *DirectiveExampleUpdateOne) ClearOnMutationCreate() *DirectiveExampleUpdateOne { + deuo.mutation.ClearOnMutationCreate() + return deuo +} + +// SetOnMutationUpdate sets the "on_mutation_update" field. +func (deuo *DirectiveExampleUpdateOne) SetOnMutationUpdate(s string) *DirectiveExampleUpdateOne { + deuo.mutation.SetOnMutationUpdate(s) + return deuo +} + +// SetNillableOnMutationUpdate sets the "on_mutation_update" field if the given value is not nil. +func (deuo *DirectiveExampleUpdateOne) SetNillableOnMutationUpdate(s *string) *DirectiveExampleUpdateOne { + if s != nil { + deuo.SetOnMutationUpdate(*s) + } + return deuo +} + +// ClearOnMutationUpdate clears the value of the "on_mutation_update" field. +func (deuo *DirectiveExampleUpdateOne) ClearOnMutationUpdate() *DirectiveExampleUpdateOne { + deuo.mutation.ClearOnMutationUpdate() + return deuo +} + +// SetOnAllFields sets the "on_all_fields" field. +func (deuo *DirectiveExampleUpdateOne) SetOnAllFields(s string) *DirectiveExampleUpdateOne { + deuo.mutation.SetOnAllFields(s) + return deuo +} + +// SetNillableOnAllFields sets the "on_all_fields" field if the given value is not nil. +func (deuo *DirectiveExampleUpdateOne) SetNillableOnAllFields(s *string) *DirectiveExampleUpdateOne { + if s != nil { + deuo.SetOnAllFields(*s) + } + return deuo +} + +// ClearOnAllFields clears the value of the "on_all_fields" field. +func (deuo *DirectiveExampleUpdateOne) ClearOnAllFields() *DirectiveExampleUpdateOne { + deuo.mutation.ClearOnAllFields() + return deuo +} + +// Mutation returns the DirectiveExampleMutation object of the builder. +func (deuo *DirectiveExampleUpdateOne) Mutation() *DirectiveExampleMutation { + return deuo.mutation +} + +// Where appends a list predicates to the DirectiveExampleUpdate builder. +func (deuo *DirectiveExampleUpdateOne) Where(ps ...predicate.DirectiveExample) *DirectiveExampleUpdateOne { + deuo.mutation.Where(ps...) + return deuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (deuo *DirectiveExampleUpdateOne) Select(field string, fields ...string) *DirectiveExampleUpdateOne { + deuo.fields = append([]string{field}, fields...) + return deuo +} + +// Save executes the query and returns the updated DirectiveExample entity. +func (deuo *DirectiveExampleUpdateOne) Save(ctx context.Context) (*DirectiveExample, error) { + return withHooks(ctx, deuo.sqlSave, deuo.mutation, deuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (deuo *DirectiveExampleUpdateOne) SaveX(ctx context.Context) *DirectiveExample { + node, err := deuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (deuo *DirectiveExampleUpdateOne) Exec(ctx context.Context) error { + _, err := deuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (deuo *DirectiveExampleUpdateOne) ExecX(ctx context.Context) { + if err := deuo.Exec(ctx); err != nil { + panic(err) + } +} + +// Modify adds a statement modifier for attaching custom logic to the UPDATE statement. +func (deuo *DirectiveExampleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DirectiveExampleUpdateOne { + deuo.modifiers = append(deuo.modifiers, modifiers...) + return deuo +} + +func (deuo *DirectiveExampleUpdateOne) sqlSave(ctx context.Context) (_node *DirectiveExample, err error) { + _spec := sqlgraph.NewUpdateSpec(directiveexample.Table, directiveexample.Columns, sqlgraph.NewFieldSpec(directiveexample.FieldID, field.TypeInt)) + id, ok := deuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "DirectiveExample.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := deuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, directiveexample.FieldID) + for _, f := range fields { + if !directiveexample.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} + } + if f != directiveexample.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := deuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := deuo.mutation.OnTypeField(); ok { + _spec.SetField(directiveexample.FieldOnTypeField, field.TypeString, value) + } + if deuo.mutation.OnTypeFieldCleared() { + _spec.ClearField(directiveexample.FieldOnTypeField, field.TypeString) + } + if value, ok := deuo.mutation.OnMutationFields(); ok { + _spec.SetField(directiveexample.FieldOnMutationFields, field.TypeString, value) + } + if deuo.mutation.OnMutationFieldsCleared() { + _spec.ClearField(directiveexample.FieldOnMutationFields, field.TypeString) + } + if value, ok := deuo.mutation.OnMutationCreate(); ok { + _spec.SetField(directiveexample.FieldOnMutationCreate, field.TypeString, value) + } + if deuo.mutation.OnMutationCreateCleared() { + _spec.ClearField(directiveexample.FieldOnMutationCreate, field.TypeString) + } + if value, ok := deuo.mutation.OnMutationUpdate(); ok { + _spec.SetField(directiveexample.FieldOnMutationUpdate, field.TypeString, value) + } + if deuo.mutation.OnMutationUpdateCleared() { + _spec.ClearField(directiveexample.FieldOnMutationUpdate, field.TypeString) + } + if value, ok := deuo.mutation.OnAllFields(); ok { + _spec.SetField(directiveexample.FieldOnAllFields, field.TypeString, value) + } + if deuo.mutation.OnAllFieldsCleared() { + _spec.ClearField(directiveexample.FieldOnAllFields, field.TypeString) + } + _spec.AddModifiers(deuo.modifiers...) + _node = &DirectiveExample{config: deuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, deuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{directiveexample.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + deuo.mutation.done = true + return _node, nil +} diff --git a/entgql/internal/todo/ent/ent.go b/entgql/internal/todo/ent/ent.go index def4b72c2..2b4a1f74c 100644 --- a/entgql/internal/todo/ent/ent.go +++ b/entgql/internal/todo/ent/ent.go @@ -25,6 +25,7 @@ import ( "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -96,16 +97,17 @@ var ( func checkColumn(table, column string) error { initCheck.Do(func() { columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ - billproduct.Table: billproduct.ValidColumn, - category.Table: category.ValidColumn, - friendship.Table: friendship.ValidColumn, - group.Table: group.ValidColumn, - onetomany.Table: onetomany.ValidColumn, - project.Table: project.ValidColumn, - todo.Table: todo.ValidColumn, - user.Table: user.ValidColumn, - verysecret.Table: verysecret.ValidColumn, - workspace.Table: workspace.ValidColumn, + billproduct.Table: billproduct.ValidColumn, + category.Table: category.ValidColumn, + directiveexample.Table: directiveexample.ValidColumn, + friendship.Table: friendship.ValidColumn, + group.Table: group.ValidColumn, + onetomany.Table: onetomany.ValidColumn, + project.Table: project.ValidColumn, + todo.Table: todo.ValidColumn, + user.Table: user.ValidColumn, + verysecret.Table: verysecret.ValidColumn, + workspace.Table: workspace.ValidColumn, }) }) return columnCheck(table, column) diff --git a/entgql/internal/todo/ent/gql_collection.go b/entgql/internal/todo/ent/gql_collection.go index ebe4ddd37..29cbe3a19 100644 --- a/entgql/internal/todo/ent/gql_collection.go +++ b/entgql/internal/todo/ent/gql_collection.go @@ -24,6 +24,7 @@ import ( "entgo.io/contrib/entgql" "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -419,6 +420,93 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { return args } +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (de *DirectiveExampleQuery) CollectFields(ctx context.Context, satisfies ...string) (*DirectiveExampleQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return de, nil + } + if err := de.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return de, nil +} + +func (de *DirectiveExampleQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { + path = append([]string(nil), path...) + var ( + unknownSeen bool + fieldSeen = make(map[string]struct{}, len(directiveexample.Columns)) + selectedFields = []string{directiveexample.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "onTypeField": + if _, ok := fieldSeen[directiveexample.FieldOnTypeField]; !ok { + selectedFields = append(selectedFields, directiveexample.FieldOnTypeField) + fieldSeen[directiveexample.FieldOnTypeField] = struct{}{} + } + case "onMutationFields": + if _, ok := fieldSeen[directiveexample.FieldOnMutationFields]; !ok { + selectedFields = append(selectedFields, directiveexample.FieldOnMutationFields) + fieldSeen[directiveexample.FieldOnMutationFields] = struct{}{} + } + case "onMutationCreate": + if _, ok := fieldSeen[directiveexample.FieldOnMutationCreate]; !ok { + selectedFields = append(selectedFields, directiveexample.FieldOnMutationCreate) + fieldSeen[directiveexample.FieldOnMutationCreate] = struct{}{} + } + case "onMutationUpdate": + if _, ok := fieldSeen[directiveexample.FieldOnMutationUpdate]; !ok { + selectedFields = append(selectedFields, directiveexample.FieldOnMutationUpdate) + fieldSeen[directiveexample.FieldOnMutationUpdate] = struct{}{} + } + case "onAllFields": + if _, ok := fieldSeen[directiveexample.FieldOnAllFields]; !ok { + selectedFields = append(selectedFields, directiveexample.FieldOnAllFields) + fieldSeen[directiveexample.FieldOnAllFields] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + de.Select(selectedFields...) + } + return nil +} + +type directiveexamplePaginateArgs struct { + first, last *int + after, before *Cursor + opts []DirectiveExamplePaginateOption +} + +func newDirectiveExamplePaginateArgs(rv map[string]any) *directiveexamplePaginateArgs { + args := &directiveexamplePaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[whereField].(*DirectiveExampleWhereInput); ok { + args.opts = append(args.opts, WithDirectiveExampleFilter(v.Filter)) + } + return args +} + // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) diff --git a/entgql/internal/todo/ent/gql_mutation_input.go b/entgql/internal/todo/ent/gql_mutation_input.go index 08842e642..a8345214e 100644 --- a/entgql/internal/todo/ent/gql_mutation_input.go +++ b/entgql/internal/todo/ent/gql_mutation_input.go @@ -167,6 +167,100 @@ func (c *CategoryUpdateOne) SetInput(i UpdateCategoryInput) *CategoryUpdateOne { return c } +// CreateDirectiveExampleInput represents a mutation input for creating directiveexamples. +type CreateDirectiveExampleInput struct { + OnTypeField *string + OnMutationFields *string + OnMutationCreate *string + OnMutationUpdate *string + OnAllFields *string +} + +// Mutate applies the CreateDirectiveExampleInput on the DirectiveExampleMutation builder. +func (i *CreateDirectiveExampleInput) Mutate(m *DirectiveExampleMutation) { + if v := i.OnTypeField; v != nil { + m.SetOnTypeField(*v) + } + if v := i.OnMutationFields; v != nil { + m.SetOnMutationFields(*v) + } + if v := i.OnMutationCreate; v != nil { + m.SetOnMutationCreate(*v) + } + if v := i.OnMutationUpdate; v != nil { + m.SetOnMutationUpdate(*v) + } + if v := i.OnAllFields; v != nil { + m.SetOnAllFields(*v) + } +} + +// SetInput applies the change-set in the CreateDirectiveExampleInput on the DirectiveExampleCreate builder. +func (c *DirectiveExampleCreate) SetInput(i CreateDirectiveExampleInput) *DirectiveExampleCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateDirectiveExampleInput represents a mutation input for updating directiveexamples. +type UpdateDirectiveExampleInput struct { + ClearOnTypeField bool + OnTypeField *string + ClearOnMutationFields bool + OnMutationFields *string + ClearOnMutationCreate bool + OnMutationCreate *string + ClearOnMutationUpdate bool + OnMutationUpdate *string + ClearOnAllFields bool + OnAllFields *string +} + +// Mutate applies the UpdateDirectiveExampleInput on the DirectiveExampleMutation builder. +func (i *UpdateDirectiveExampleInput) Mutate(m *DirectiveExampleMutation) { + if i.ClearOnTypeField { + m.ClearOnTypeField() + } + if v := i.OnTypeField; v != nil { + m.SetOnTypeField(*v) + } + if i.ClearOnMutationFields { + m.ClearOnMutationFields() + } + if v := i.OnMutationFields; v != nil { + m.SetOnMutationFields(*v) + } + if i.ClearOnMutationCreate { + m.ClearOnMutationCreate() + } + if v := i.OnMutationCreate; v != nil { + m.SetOnMutationCreate(*v) + } + if i.ClearOnMutationUpdate { + m.ClearOnMutationUpdate() + } + if v := i.OnMutationUpdate; v != nil { + m.SetOnMutationUpdate(*v) + } + if i.ClearOnAllFields { + m.ClearOnAllFields() + } + if v := i.OnAllFields; v != nil { + m.SetOnAllFields(*v) + } +} + +// SetInput applies the change-set in the UpdateDirectiveExampleInput on the DirectiveExampleUpdate builder. +func (c *DirectiveExampleUpdate) SetInput(i UpdateDirectiveExampleInput) *DirectiveExampleUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateDirectiveExampleInput on the DirectiveExampleUpdateOne builder. +func (c *DirectiveExampleUpdateOne) SetInput(i UpdateDirectiveExampleInput) *DirectiveExampleUpdateOne { + i.Mutate(c.Mutation()) + return c +} + // UpdateFriendshipInput represents a mutation input for updating friendships. type UpdateFriendshipInput struct { CreatedAt *time.Time diff --git a/entgql/internal/todo/ent/gql_node.go b/entgql/internal/todo/ent/gql_node.go index 6af6bc93e..c17921bed 100644 --- a/entgql/internal/todo/ent/gql_node.go +++ b/entgql/internal/todo/ent/gql_node.go @@ -25,6 +25,7 @@ import ( "entgo.io/contrib/entgql" "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -56,6 +57,11 @@ var categoryImplementors = []string{"Category", "Node"} // IsNode implements the Node interface check for GQLGen. func (*Category) IsNode() {} +var directiveexampleImplementors = []string{"DirectiveExample", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*DirectiveExample) IsNode() {} + var friendshipImplementors = []string{"Friendship", "Node"} // IsNode implements the Node interface check for GQLGen. @@ -170,6 +176,15 @@ func (c *Client) noder(ctx context.Context, table string, id int) (Noder, error) } } return query.Only(ctx) + case directiveexample.Table: + query := c.DirectiveExample.Query(). + Where(directiveexample.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, directiveexampleImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) case friendship.Table: query := c.Friendship.Query(). Where(friendship.ID(id)) @@ -338,6 +353,22 @@ func (c *Client) noders(ctx context.Context, table string, ids []int) ([]Noder, *noder = node } } + case directiveexample.Table: + query := c.DirectiveExample.Query(). + Where(directiveexample.IDIn(ids...)) + query, err := query.CollectFields(ctx, directiveexampleImplementors...) + if err != nil { + return nil, err + } + nodes, err := query.All(ctx) + if err != nil { + return nil, err + } + for _, node := range nodes { + for _, noder := range idmap[node.ID] { + *noder = node + } + } case friendship.Table: query := c.Friendship.Query(). Where(friendship.IDIn(ids...)) diff --git a/entgql/internal/todo/ent/gql_node_descriptor.go b/entgql/internal/todo/ent/gql_node_descriptor.go index fbdf93b28..70c90d144 100644 --- a/entgql/internal/todo/ent/gql_node_descriptor.go +++ b/entgql/internal/todo/ent/gql_node_descriptor.go @@ -174,6 +174,58 @@ func (c *Category) Node(ctx context.Context) (node *Node, err error) { return node, nil } +// Node implements Noder interface +func (de *DirectiveExample) Node(ctx context.Context) (node *Node, err error) { + node = &Node{ + ID: de.ID, + Type: "DirectiveExample", + Fields: make([]*Field, 5), + Edges: make([]*Edge, 0), + } + var buf []byte + if buf, err = json.Marshal(de.OnTypeField); err != nil { + return nil, err + } + node.Fields[0] = &Field{ + Type: "string", + Name: "on_type_field", + Value: string(buf), + } + if buf, err = json.Marshal(de.OnMutationFields); err != nil { + return nil, err + } + node.Fields[1] = &Field{ + Type: "string", + Name: "on_mutation_fields", + Value: string(buf), + } + if buf, err = json.Marshal(de.OnMutationCreate); err != nil { + return nil, err + } + node.Fields[2] = &Field{ + Type: "string", + Name: "on_mutation_create", + Value: string(buf), + } + if buf, err = json.Marshal(de.OnMutationUpdate); err != nil { + return nil, err + } + node.Fields[3] = &Field{ + Type: "string", + Name: "on_mutation_update", + Value: string(buf), + } + if buf, err = json.Marshal(de.OnAllFields); err != nil { + return nil, err + } + node.Fields[4] = &Field{ + Type: "string", + Name: "on_all_fields", + Value: string(buf), + } + return node, nil +} + // Node implements Noder interface func (f *Friendship) Node(ctx context.Context) (node *Node, err error) { node = &Node{ diff --git a/entgql/internal/todo/ent/gql_pagination.go b/entgql/internal/todo/ent/gql_pagination.go index 89d25786a..0ce25e7d5 100644 --- a/entgql/internal/todo/ent/gql_pagination.go +++ b/entgql/internal/todo/ent/gql_pagination.go @@ -26,6 +26,7 @@ import ( "entgo.io/contrib/entgql" "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -809,6 +810,255 @@ func (c *Category) ToEdge(order *CategoryOrder) *CategoryEdge { } } +// DirectiveExampleEdge is the edge representation of DirectiveExample. +type DirectiveExampleEdge struct { + Node *DirectiveExample `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// DirectiveExampleConnection is the connection containing edges to DirectiveExample. +type DirectiveExampleConnection struct { + Edges []*DirectiveExampleEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *DirectiveExampleConnection) build(nodes []*DirectiveExample, pager *directiveexamplePager, after *Cursor, first *int, before *Cursor, last *int) { + c.PageInfo.HasNextPage = before != nil + c.PageInfo.HasPreviousPage = after != nil + if first != nil && *first+1 == len(nodes) { + c.PageInfo.HasNextPage = true + nodes = nodes[:len(nodes)-1] + } else if last != nil && *last+1 == len(nodes) { + c.PageInfo.HasPreviousPage = true + nodes = nodes[:len(nodes)-1] + } + var nodeAt func(int) *DirectiveExample + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *DirectiveExample { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *DirectiveExample { + return nodes[i] + } + } + c.Edges = make([]*DirectiveExampleEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &DirectiveExampleEdge{ + Node: node, + Cursor: pager.toCursor(node), + } + } + if l := len(c.Edges); l > 0 { + c.PageInfo.StartCursor = &c.Edges[0].Cursor + c.PageInfo.EndCursor = &c.Edges[l-1].Cursor + } + if c.TotalCount == 0 { + c.TotalCount = len(nodes) + } +} + +// DirectiveExamplePaginateOption enables pagination customization. +type DirectiveExamplePaginateOption func(*directiveexamplePager) error + +// WithDirectiveExampleOrder configures pagination ordering. +func WithDirectiveExampleOrder(order *DirectiveExampleOrder) DirectiveExamplePaginateOption { + if order == nil { + order = DefaultDirectiveExampleOrder + } + o := *order + return func(pager *directiveexamplePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultDirectiveExampleOrder.Field + } + pager.order = &o + return nil + } +} + +// WithDirectiveExampleFilter configures pagination filter. +func WithDirectiveExampleFilter(filter func(*DirectiveExampleQuery) (*DirectiveExampleQuery, error)) DirectiveExamplePaginateOption { + return func(pager *directiveexamplePager) error { + if filter == nil { + return errors.New("DirectiveExampleQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type directiveexamplePager struct { + reverse bool + order *DirectiveExampleOrder + filter func(*DirectiveExampleQuery) (*DirectiveExampleQuery, error) +} + +func newDirectiveExamplePager(opts []DirectiveExamplePaginateOption, reverse bool) (*directiveexamplePager, error) { + pager := &directiveexamplePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultDirectiveExampleOrder + } + return pager, nil +} + +func (p *directiveexamplePager) applyFilter(query *DirectiveExampleQuery) (*DirectiveExampleQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *directiveexamplePager) toCursor(de *DirectiveExample) Cursor { + return p.order.Field.toCursor(de) +} + +func (p *directiveexamplePager) applyCursors(query *DirectiveExampleQuery, after, before *Cursor) (*DirectiveExampleQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultDirectiveExampleOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *directiveexamplePager) applyOrder(query *DirectiveExampleQuery) *DirectiveExampleQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultDirectiveExampleOrder.Field { + query = query.Order(DefaultDirectiveExampleOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *directiveexamplePager) orderExpr(query *DirectiveExampleQuery) sql.Querier { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return sql.ExprFunc(func(b *sql.Builder) { + b.Ident(p.order.Field.column).Pad().WriteString(string(direction)) + if p.order.Field != DefaultDirectiveExampleOrder.Field { + b.Comma().Ident(DefaultDirectiveExampleOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to DirectiveExample. +func (de *DirectiveExampleQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...DirectiveExamplePaginateOption, +) (*DirectiveExampleConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newDirectiveExamplePager(opts, last != nil) + if err != nil { + return nil, err + } + if de, err = pager.applyFilter(de); err != nil { + return nil, err + } + conn := &DirectiveExampleConnection{Edges: []*DirectiveExampleEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := de.Clone() + c.ctx.Fields = nil + if conn.TotalCount, err = c.Count(ctx); err != nil { + return nil, err + } + conn.PageInfo.HasNextPage = first != nil && conn.TotalCount > 0 + conn.PageInfo.HasPreviousPage = last != nil && conn.TotalCount > 0 + } + } + if ignoredEdges || (first != nil && *first == 0) || (last != nil && *last == 0) { + return conn, nil + } + if de, err = pager.applyCursors(de, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + de.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := de.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + de = pager.applyOrder(de) + nodes, err := de.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// DirectiveExampleOrderField defines the ordering field of DirectiveExample. +type DirectiveExampleOrderField struct { + // Value extracts the ordering value from the given DirectiveExample. + Value func(*DirectiveExample) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) directiveexample.OrderOption + toCursor func(*DirectiveExample) Cursor +} + +// DirectiveExampleOrder defines the ordering of DirectiveExample. +type DirectiveExampleOrder struct { + Direction OrderDirection `json:"direction"` + Field *DirectiveExampleOrderField `json:"field"` +} + +// DefaultDirectiveExampleOrder is the default ordering of DirectiveExample. +var DefaultDirectiveExampleOrder = &DirectiveExampleOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &DirectiveExampleOrderField{ + Value: func(de *DirectiveExample) (ent.Value, error) { + return de.ID, nil + }, + column: directiveexample.FieldID, + toTerm: directiveexample.ByID, + toCursor: func(de *DirectiveExample) Cursor { + return Cursor{ID: de.ID} + }, + }, +} + +// ToEdge converts DirectiveExample into DirectiveExampleEdge. +func (de *DirectiveExample) ToEdge(order *DirectiveExampleOrder) *DirectiveExampleEdge { + if order == nil { + order = DefaultDirectiveExampleOrder + } + return &DirectiveExampleEdge{ + Node: de, + Cursor: order.Field.toCursor(de), + } +} + // FriendshipEdge is the edge representation of Friendship. type FriendshipEdge struct { Node *Friendship `json:"node"` diff --git a/entgql/internal/todo/ent/gql_where_input.go b/entgql/internal/todo/ent/gql_where_input.go index 060d464d6..f5f5b25f3 100644 --- a/entgql/internal/todo/ent/gql_where_input.go +++ b/entgql/internal/todo/ent/gql_where_input.go @@ -23,6 +23,7 @@ import ( "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -667,6 +668,440 @@ func (i *CategoryWhereInput) P() (predicate.Category, error) { } } +// DirectiveExampleWhereInput represents a where input for filtering DirectiveExample queries. +type DirectiveExampleWhereInput struct { + Predicates []predicate.DirectiveExample `json:"-"` + Not *DirectiveExampleWhereInput `json:"not,omitempty"` + Or []*DirectiveExampleWhereInput `json:"or,omitempty"` + And []*DirectiveExampleWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *int `json:"id,omitempty"` + IDNEQ *int `json:"idNEQ,omitempty"` + IDIn []int `json:"idIn,omitempty"` + IDNotIn []int `json:"idNotIn,omitempty"` + IDGT *int `json:"idGT,omitempty"` + IDGTE *int `json:"idGTE,omitempty"` + IDLT *int `json:"idLT,omitempty"` + IDLTE *int `json:"idLTE,omitempty"` + + // "on_type_field" field predicates. + OnTypeField *string `json:"onTypeField,omitempty"` + OnTypeFieldNEQ *string `json:"onTypeFieldNEQ,omitempty"` + OnTypeFieldIn []string `json:"onTypeFieldIn,omitempty"` + OnTypeFieldNotIn []string `json:"onTypeFieldNotIn,omitempty"` + OnTypeFieldGT *string `json:"onTypeFieldGT,omitempty"` + OnTypeFieldGTE *string `json:"onTypeFieldGTE,omitempty"` + OnTypeFieldLT *string `json:"onTypeFieldLT,omitempty"` + OnTypeFieldLTE *string `json:"onTypeFieldLTE,omitempty"` + OnTypeFieldContains *string `json:"onTypeFieldContains,omitempty"` + OnTypeFieldHasPrefix *string `json:"onTypeFieldHasPrefix,omitempty"` + OnTypeFieldHasSuffix *string `json:"onTypeFieldHasSuffix,omitempty"` + OnTypeFieldIsNil bool `json:"onTypeFieldIsNil,omitempty"` + OnTypeFieldNotNil bool `json:"onTypeFieldNotNil,omitempty"` + OnTypeFieldEqualFold *string `json:"onTypeFieldEqualFold,omitempty"` + OnTypeFieldContainsFold *string `json:"onTypeFieldContainsFold,omitempty"` + + // "on_mutation_fields" field predicates. + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationFieldsNEQ *string `json:"onMutationFieldsNEQ,omitempty"` + OnMutationFieldsIn []string `json:"onMutationFieldsIn,omitempty"` + OnMutationFieldsNotIn []string `json:"onMutationFieldsNotIn,omitempty"` + OnMutationFieldsGT *string `json:"onMutationFieldsGT,omitempty"` + OnMutationFieldsGTE *string `json:"onMutationFieldsGTE,omitempty"` + OnMutationFieldsLT *string `json:"onMutationFieldsLT,omitempty"` + OnMutationFieldsLTE *string `json:"onMutationFieldsLTE,omitempty"` + OnMutationFieldsContains *string `json:"onMutationFieldsContains,omitempty"` + OnMutationFieldsHasPrefix *string `json:"onMutationFieldsHasPrefix,omitempty"` + OnMutationFieldsHasSuffix *string `json:"onMutationFieldsHasSuffix,omitempty"` + OnMutationFieldsIsNil bool `json:"onMutationFieldsIsNil,omitempty"` + OnMutationFieldsNotNil bool `json:"onMutationFieldsNotNil,omitempty"` + OnMutationFieldsEqualFold *string `json:"onMutationFieldsEqualFold,omitempty"` + OnMutationFieldsContainsFold *string `json:"onMutationFieldsContainsFold,omitempty"` + + // "on_mutation_create" field predicates. + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationCreateNEQ *string `json:"onMutationCreateNEQ,omitempty"` + OnMutationCreateIn []string `json:"onMutationCreateIn,omitempty"` + OnMutationCreateNotIn []string `json:"onMutationCreateNotIn,omitempty"` + OnMutationCreateGT *string `json:"onMutationCreateGT,omitempty"` + OnMutationCreateGTE *string `json:"onMutationCreateGTE,omitempty"` + OnMutationCreateLT *string `json:"onMutationCreateLT,omitempty"` + OnMutationCreateLTE *string `json:"onMutationCreateLTE,omitempty"` + OnMutationCreateContains *string `json:"onMutationCreateContains,omitempty"` + OnMutationCreateHasPrefix *string `json:"onMutationCreateHasPrefix,omitempty"` + OnMutationCreateHasSuffix *string `json:"onMutationCreateHasSuffix,omitempty"` + OnMutationCreateIsNil bool `json:"onMutationCreateIsNil,omitempty"` + OnMutationCreateNotNil bool `json:"onMutationCreateNotNil,omitempty"` + OnMutationCreateEqualFold *string `json:"onMutationCreateEqualFold,omitempty"` + OnMutationCreateContainsFold *string `json:"onMutationCreateContainsFold,omitempty"` + + // "on_mutation_update" field predicates. + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnMutationUpdateNEQ *string `json:"onMutationUpdateNEQ,omitempty"` + OnMutationUpdateIn []string `json:"onMutationUpdateIn,omitempty"` + OnMutationUpdateNotIn []string `json:"onMutationUpdateNotIn,omitempty"` + OnMutationUpdateGT *string `json:"onMutationUpdateGT,omitempty"` + OnMutationUpdateGTE *string `json:"onMutationUpdateGTE,omitempty"` + OnMutationUpdateLT *string `json:"onMutationUpdateLT,omitempty"` + OnMutationUpdateLTE *string `json:"onMutationUpdateLTE,omitempty"` + OnMutationUpdateContains *string `json:"onMutationUpdateContains,omitempty"` + OnMutationUpdateHasPrefix *string `json:"onMutationUpdateHasPrefix,omitempty"` + OnMutationUpdateHasSuffix *string `json:"onMutationUpdateHasSuffix,omitempty"` + OnMutationUpdateIsNil bool `json:"onMutationUpdateIsNil,omitempty"` + OnMutationUpdateNotNil bool `json:"onMutationUpdateNotNil,omitempty"` + OnMutationUpdateEqualFold *string `json:"onMutationUpdateEqualFold,omitempty"` + OnMutationUpdateContainsFold *string `json:"onMutationUpdateContainsFold,omitempty"` + + // "on_all_fields" field predicates. + OnAllFields *string `json:"onAllFields,omitempty"` + OnAllFieldsNEQ *string `json:"onAllFieldsNEQ,omitempty"` + OnAllFieldsIn []string `json:"onAllFieldsIn,omitempty"` + OnAllFieldsNotIn []string `json:"onAllFieldsNotIn,omitempty"` + OnAllFieldsGT *string `json:"onAllFieldsGT,omitempty"` + OnAllFieldsGTE *string `json:"onAllFieldsGTE,omitempty"` + OnAllFieldsLT *string `json:"onAllFieldsLT,omitempty"` + OnAllFieldsLTE *string `json:"onAllFieldsLTE,omitempty"` + OnAllFieldsContains *string `json:"onAllFieldsContains,omitempty"` + OnAllFieldsHasPrefix *string `json:"onAllFieldsHasPrefix,omitempty"` + OnAllFieldsHasSuffix *string `json:"onAllFieldsHasSuffix,omitempty"` + OnAllFieldsIsNil bool `json:"onAllFieldsIsNil,omitempty"` + OnAllFieldsNotNil bool `json:"onAllFieldsNotNil,omitempty"` + OnAllFieldsEqualFold *string `json:"onAllFieldsEqualFold,omitempty"` + OnAllFieldsContainsFold *string `json:"onAllFieldsContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *DirectiveExampleWhereInput) AddPredicates(predicates ...predicate.DirectiveExample) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the DirectiveExampleWhereInput filter on the DirectiveExampleQuery builder. +func (i *DirectiveExampleWhereInput) Filter(q *DirectiveExampleQuery) (*DirectiveExampleQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyDirectiveExampleWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyDirectiveExampleWhereInput is returned in case the DirectiveExampleWhereInput is empty. +var ErrEmptyDirectiveExampleWhereInput = errors.New("ent: empty predicate DirectiveExampleWhereInput") + +// P returns a predicate for filtering directiveexamples. +// An error is returned if the input is empty or invalid. +func (i *DirectiveExampleWhereInput) P() (predicate.DirectiveExample, error) { + var predicates []predicate.DirectiveExample + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, directiveexample.Not(p)) + } + switch n := len(i.Or); { + case n == 1: + p, err := i.Or[0].P() + if err != nil { + return nil, fmt.Errorf("%w: field 'or'", err) + } + predicates = append(predicates, p) + case n > 1: + or := make([]predicate.DirectiveExample, 0, n) + for _, w := range i.Or { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'or'", err) + } + or = append(or, p) + } + predicates = append(predicates, directiveexample.Or(or...)) + } + switch n := len(i.And); { + case n == 1: + p, err := i.And[0].P() + if err != nil { + return nil, fmt.Errorf("%w: field 'and'", err) + } + predicates = append(predicates, p) + case n > 1: + and := make([]predicate.DirectiveExample, 0, n) + for _, w := range i.And { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'and'", err) + } + and = append(and, p) + } + predicates = append(predicates, directiveexample.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, directiveexample.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, directiveexample.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, directiveexample.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, directiveexample.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, directiveexample.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, directiveexample.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, directiveexample.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, directiveexample.IDLTE(*i.IDLTE)) + } + if i.OnTypeField != nil { + predicates = append(predicates, directiveexample.OnTypeFieldEQ(*i.OnTypeField)) + } + if i.OnTypeFieldNEQ != nil { + predicates = append(predicates, directiveexample.OnTypeFieldNEQ(*i.OnTypeFieldNEQ)) + } + if len(i.OnTypeFieldIn) > 0 { + predicates = append(predicates, directiveexample.OnTypeFieldIn(i.OnTypeFieldIn...)) + } + if len(i.OnTypeFieldNotIn) > 0 { + predicates = append(predicates, directiveexample.OnTypeFieldNotIn(i.OnTypeFieldNotIn...)) + } + if i.OnTypeFieldGT != nil { + predicates = append(predicates, directiveexample.OnTypeFieldGT(*i.OnTypeFieldGT)) + } + if i.OnTypeFieldGTE != nil { + predicates = append(predicates, directiveexample.OnTypeFieldGTE(*i.OnTypeFieldGTE)) + } + if i.OnTypeFieldLT != nil { + predicates = append(predicates, directiveexample.OnTypeFieldLT(*i.OnTypeFieldLT)) + } + if i.OnTypeFieldLTE != nil { + predicates = append(predicates, directiveexample.OnTypeFieldLTE(*i.OnTypeFieldLTE)) + } + if i.OnTypeFieldContains != nil { + predicates = append(predicates, directiveexample.OnTypeFieldContains(*i.OnTypeFieldContains)) + } + if i.OnTypeFieldHasPrefix != nil { + predicates = append(predicates, directiveexample.OnTypeFieldHasPrefix(*i.OnTypeFieldHasPrefix)) + } + if i.OnTypeFieldHasSuffix != nil { + predicates = append(predicates, directiveexample.OnTypeFieldHasSuffix(*i.OnTypeFieldHasSuffix)) + } + if i.OnTypeFieldIsNil { + predicates = append(predicates, directiveexample.OnTypeFieldIsNil()) + } + if i.OnTypeFieldNotNil { + predicates = append(predicates, directiveexample.OnTypeFieldNotNil()) + } + if i.OnTypeFieldEqualFold != nil { + predicates = append(predicates, directiveexample.OnTypeFieldEqualFold(*i.OnTypeFieldEqualFold)) + } + if i.OnTypeFieldContainsFold != nil { + predicates = append(predicates, directiveexample.OnTypeFieldContainsFold(*i.OnTypeFieldContainsFold)) + } + if i.OnMutationFields != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsEQ(*i.OnMutationFields)) + } + if i.OnMutationFieldsNEQ != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsNEQ(*i.OnMutationFieldsNEQ)) + } + if len(i.OnMutationFieldsIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationFieldsIn(i.OnMutationFieldsIn...)) + } + if len(i.OnMutationFieldsNotIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationFieldsNotIn(i.OnMutationFieldsNotIn...)) + } + if i.OnMutationFieldsGT != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsGT(*i.OnMutationFieldsGT)) + } + if i.OnMutationFieldsGTE != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsGTE(*i.OnMutationFieldsGTE)) + } + if i.OnMutationFieldsLT != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsLT(*i.OnMutationFieldsLT)) + } + if i.OnMutationFieldsLTE != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsLTE(*i.OnMutationFieldsLTE)) + } + if i.OnMutationFieldsContains != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsContains(*i.OnMutationFieldsContains)) + } + if i.OnMutationFieldsHasPrefix != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsHasPrefix(*i.OnMutationFieldsHasPrefix)) + } + if i.OnMutationFieldsHasSuffix != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsHasSuffix(*i.OnMutationFieldsHasSuffix)) + } + if i.OnMutationFieldsIsNil { + predicates = append(predicates, directiveexample.OnMutationFieldsIsNil()) + } + if i.OnMutationFieldsNotNil { + predicates = append(predicates, directiveexample.OnMutationFieldsNotNil()) + } + if i.OnMutationFieldsEqualFold != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsEqualFold(*i.OnMutationFieldsEqualFold)) + } + if i.OnMutationFieldsContainsFold != nil { + predicates = append(predicates, directiveexample.OnMutationFieldsContainsFold(*i.OnMutationFieldsContainsFold)) + } + if i.OnMutationCreate != nil { + predicates = append(predicates, directiveexample.OnMutationCreateEQ(*i.OnMutationCreate)) + } + if i.OnMutationCreateNEQ != nil { + predicates = append(predicates, directiveexample.OnMutationCreateNEQ(*i.OnMutationCreateNEQ)) + } + if len(i.OnMutationCreateIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationCreateIn(i.OnMutationCreateIn...)) + } + if len(i.OnMutationCreateNotIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationCreateNotIn(i.OnMutationCreateNotIn...)) + } + if i.OnMutationCreateGT != nil { + predicates = append(predicates, directiveexample.OnMutationCreateGT(*i.OnMutationCreateGT)) + } + if i.OnMutationCreateGTE != nil { + predicates = append(predicates, directiveexample.OnMutationCreateGTE(*i.OnMutationCreateGTE)) + } + if i.OnMutationCreateLT != nil { + predicates = append(predicates, directiveexample.OnMutationCreateLT(*i.OnMutationCreateLT)) + } + if i.OnMutationCreateLTE != nil { + predicates = append(predicates, directiveexample.OnMutationCreateLTE(*i.OnMutationCreateLTE)) + } + if i.OnMutationCreateContains != nil { + predicates = append(predicates, directiveexample.OnMutationCreateContains(*i.OnMutationCreateContains)) + } + if i.OnMutationCreateHasPrefix != nil { + predicates = append(predicates, directiveexample.OnMutationCreateHasPrefix(*i.OnMutationCreateHasPrefix)) + } + if i.OnMutationCreateHasSuffix != nil { + predicates = append(predicates, directiveexample.OnMutationCreateHasSuffix(*i.OnMutationCreateHasSuffix)) + } + if i.OnMutationCreateIsNil { + predicates = append(predicates, directiveexample.OnMutationCreateIsNil()) + } + if i.OnMutationCreateNotNil { + predicates = append(predicates, directiveexample.OnMutationCreateNotNil()) + } + if i.OnMutationCreateEqualFold != nil { + predicates = append(predicates, directiveexample.OnMutationCreateEqualFold(*i.OnMutationCreateEqualFold)) + } + if i.OnMutationCreateContainsFold != nil { + predicates = append(predicates, directiveexample.OnMutationCreateContainsFold(*i.OnMutationCreateContainsFold)) + } + if i.OnMutationUpdate != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateEQ(*i.OnMutationUpdate)) + } + if i.OnMutationUpdateNEQ != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateNEQ(*i.OnMutationUpdateNEQ)) + } + if len(i.OnMutationUpdateIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationUpdateIn(i.OnMutationUpdateIn...)) + } + if len(i.OnMutationUpdateNotIn) > 0 { + predicates = append(predicates, directiveexample.OnMutationUpdateNotIn(i.OnMutationUpdateNotIn...)) + } + if i.OnMutationUpdateGT != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateGT(*i.OnMutationUpdateGT)) + } + if i.OnMutationUpdateGTE != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateGTE(*i.OnMutationUpdateGTE)) + } + if i.OnMutationUpdateLT != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateLT(*i.OnMutationUpdateLT)) + } + if i.OnMutationUpdateLTE != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateLTE(*i.OnMutationUpdateLTE)) + } + if i.OnMutationUpdateContains != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateContains(*i.OnMutationUpdateContains)) + } + if i.OnMutationUpdateHasPrefix != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateHasPrefix(*i.OnMutationUpdateHasPrefix)) + } + if i.OnMutationUpdateHasSuffix != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateHasSuffix(*i.OnMutationUpdateHasSuffix)) + } + if i.OnMutationUpdateIsNil { + predicates = append(predicates, directiveexample.OnMutationUpdateIsNil()) + } + if i.OnMutationUpdateNotNil { + predicates = append(predicates, directiveexample.OnMutationUpdateNotNil()) + } + if i.OnMutationUpdateEqualFold != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateEqualFold(*i.OnMutationUpdateEqualFold)) + } + if i.OnMutationUpdateContainsFold != nil { + predicates = append(predicates, directiveexample.OnMutationUpdateContainsFold(*i.OnMutationUpdateContainsFold)) + } + if i.OnAllFields != nil { + predicates = append(predicates, directiveexample.OnAllFieldsEQ(*i.OnAllFields)) + } + if i.OnAllFieldsNEQ != nil { + predicates = append(predicates, directiveexample.OnAllFieldsNEQ(*i.OnAllFieldsNEQ)) + } + if len(i.OnAllFieldsIn) > 0 { + predicates = append(predicates, directiveexample.OnAllFieldsIn(i.OnAllFieldsIn...)) + } + if len(i.OnAllFieldsNotIn) > 0 { + predicates = append(predicates, directiveexample.OnAllFieldsNotIn(i.OnAllFieldsNotIn...)) + } + if i.OnAllFieldsGT != nil { + predicates = append(predicates, directiveexample.OnAllFieldsGT(*i.OnAllFieldsGT)) + } + if i.OnAllFieldsGTE != nil { + predicates = append(predicates, directiveexample.OnAllFieldsGTE(*i.OnAllFieldsGTE)) + } + if i.OnAllFieldsLT != nil { + predicates = append(predicates, directiveexample.OnAllFieldsLT(*i.OnAllFieldsLT)) + } + if i.OnAllFieldsLTE != nil { + predicates = append(predicates, directiveexample.OnAllFieldsLTE(*i.OnAllFieldsLTE)) + } + if i.OnAllFieldsContains != nil { + predicates = append(predicates, directiveexample.OnAllFieldsContains(*i.OnAllFieldsContains)) + } + if i.OnAllFieldsHasPrefix != nil { + predicates = append(predicates, directiveexample.OnAllFieldsHasPrefix(*i.OnAllFieldsHasPrefix)) + } + if i.OnAllFieldsHasSuffix != nil { + predicates = append(predicates, directiveexample.OnAllFieldsHasSuffix(*i.OnAllFieldsHasSuffix)) + } + if i.OnAllFieldsIsNil { + predicates = append(predicates, directiveexample.OnAllFieldsIsNil()) + } + if i.OnAllFieldsNotNil { + predicates = append(predicates, directiveexample.OnAllFieldsNotNil()) + } + if i.OnAllFieldsEqualFold != nil { + predicates = append(predicates, directiveexample.OnAllFieldsEqualFold(*i.OnAllFieldsEqualFold)) + } + if i.OnAllFieldsContainsFold != nil { + predicates = append(predicates, directiveexample.OnAllFieldsContainsFold(*i.OnAllFieldsContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyDirectiveExampleWhereInput + case 1: + return predicates[0], nil + default: + return directiveexample.And(predicates...), nil + } +} + // FriendshipWhereInput represents a where input for filtering Friendship queries. type FriendshipWhereInput struct { Predicates []predicate.Friendship `json:"-"` diff --git a/entgql/internal/todo/ent/hook/hook.go b/entgql/internal/todo/ent/hook/hook.go index a1710a7be..bbcfb0f35 100644 --- a/entgql/internal/todo/ent/hook/hook.go +++ b/entgql/internal/todo/ent/hook/hook.go @@ -47,6 +47,18 @@ func (f CategoryFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.CategoryMutation", m) } +// The DirectiveExampleFunc type is an adapter to allow the use of ordinary +// function as DirectiveExample mutator. +type DirectiveExampleFunc func(context.Context, *ent.DirectiveExampleMutation) (ent.Value, error) + +// Mutate calls f(ctx, m). +func (f DirectiveExampleFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if mv, ok := m.(*ent.DirectiveExampleMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.DirectiveExampleMutation", m) +} + // The FriendshipFunc type is an adapter to allow the use of ordinary // function as Friendship mutator. type FriendshipFunc func(context.Context, *ent.FriendshipMutation) (ent.Value, error) diff --git a/entgql/internal/todo/ent/migrate/schema.go b/entgql/internal/todo/ent/migrate/schema.go index 683b904f3..cc728af42 100644 --- a/entgql/internal/todo/ent/migrate/schema.go +++ b/entgql/internal/todo/ent/migrate/schema.go @@ -52,6 +52,21 @@ var ( Columns: CategoriesColumns, PrimaryKey: []*schema.Column{CategoriesColumns[0]}, } + // DirectiveExamplesColumns holds the columns for the "directive_examples" table. + DirectiveExamplesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeInt, Increment: true}, + {Name: "on_type_field", Type: field.TypeString, Nullable: true, Size: 2147483647}, + {Name: "on_mutation_fields", Type: field.TypeString, Nullable: true, Size: 2147483647}, + {Name: "on_mutation_create", Type: field.TypeString, Nullable: true, Size: 2147483647}, + {Name: "on_mutation_update", Type: field.TypeString, Nullable: true, Size: 2147483647}, + {Name: "on_all_fields", Type: field.TypeString, Nullable: true, Size: 2147483647}, + } + // DirectiveExamplesTable holds the schema information for the "directive_examples" table. + DirectiveExamplesTable = &schema.Table{ + Name: "directive_examples", + Columns: DirectiveExamplesColumns, + PrimaryKey: []*schema.Column{DirectiveExamplesColumns[0]}, + } // FriendshipsColumns holds the columns for the "friendships" table. FriendshipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, @@ -268,6 +283,7 @@ var ( Tables = []*schema.Table{ BillProductsTable, CategoriesTable, + DirectiveExamplesTable, FriendshipsTable, GroupsTable, OneToManiesTable, diff --git a/entgql/internal/todo/ent/mutation.go b/entgql/internal/todo/ent/mutation.go index 563fbb10e..3a91b5b8c 100644 --- a/entgql/internal/todo/ent/mutation.go +++ b/entgql/internal/todo/ent/mutation.go @@ -25,6 +25,7 @@ import ( "entgo.io/contrib/entgql/internal/todo/ent/billproduct" "entgo.io/contrib/entgql/internal/todo/ent/category" + "entgo.io/contrib/entgql/internal/todo/ent/directiveexample" "entgo.io/contrib/entgql/internal/todo/ent/friendship" "entgo.io/contrib/entgql/internal/todo/ent/group" "entgo.io/contrib/entgql/internal/todo/ent/onetomany" @@ -50,16 +51,17 @@ const ( OpUpdateOne = ent.OpUpdateOne // Node types. - TypeBillProduct = "BillProduct" - TypeCategory = "Category" - TypeFriendship = "Friendship" - TypeGroup = "Group" - TypeOneToMany = "OneToMany" - TypeProject = "Project" - TypeTodo = "Todo" - TypeUser = "User" - TypeVerySecret = "VerySecret" - TypeWorkspace = "Workspace" + TypeBillProduct = "BillProduct" + TypeCategory = "Category" + TypeDirectiveExample = "DirectiveExample" + TypeFriendship = "Friendship" + TypeGroup = "Group" + TypeOneToMany = "OneToMany" + TypeProject = "Project" + TypeTodo = "Todo" + TypeUser = "User" + TypeVerySecret = "VerySecret" + TypeWorkspace = "Workspace" ) // BillProductMutation represents an operation that mutates the BillProduct nodes in the graph. @@ -1550,6 +1552,646 @@ func (m *CategoryMutation) ResetEdge(name string) error { return fmt.Errorf("unknown Category edge %s", name) } +// DirectiveExampleMutation represents an operation that mutates the DirectiveExample nodes in the graph. +type DirectiveExampleMutation struct { + config + op Op + typ string + id *int + on_type_field *string + on_mutation_fields *string + on_mutation_create *string + on_mutation_update *string + on_all_fields *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*DirectiveExample, error) + predicates []predicate.DirectiveExample +} + +var _ ent.Mutation = (*DirectiveExampleMutation)(nil) + +// directiveexampleOption allows management of the mutation configuration using functional options. +type directiveexampleOption func(*DirectiveExampleMutation) + +// newDirectiveExampleMutation creates new mutation for the DirectiveExample entity. +func newDirectiveExampleMutation(c config, op Op, opts ...directiveexampleOption) *DirectiveExampleMutation { + m := &DirectiveExampleMutation{ + config: c, + op: op, + typ: TypeDirectiveExample, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withDirectiveExampleID sets the ID field of the mutation. +func withDirectiveExampleID(id int) directiveexampleOption { + return func(m *DirectiveExampleMutation) { + var ( + err error + once sync.Once + value *DirectiveExample + ) + m.oldValue = func(ctx context.Context) (*DirectiveExample, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().DirectiveExample.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDirectiveExample sets the old DirectiveExample of the mutation. +func withDirectiveExample(node *DirectiveExample) directiveexampleOption { + return func(m *DirectiveExampleMutation) { + m.oldValue = func(context.Context) (*DirectiveExample, error) { + return node, nil + } + m.id = &node.ID + } +} + +// Client returns a new `ent.Client` from the mutation. If the mutation was +// executed in a transaction (ent.Tx), a transactional client is returned. +func (m DirectiveExampleMutation) Client() *Client { + client := &Client{config: m.config} + client.init() + return client +} + +// Tx returns an `ent.Tx` for mutations that were executed in transactions; +// it returns an error otherwise. +func (m DirectiveExampleMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("ent: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// ID returns the ID value in the mutation. Note that the ID is only available +// if it was provided to the builder or after it was returned from the database. +func (m *DirectiveExampleMutation) ID() (id int, exists bool) { + if m.id == nil { + return + } + return *m.id, true +} + +// IDs queries the database and returns the entity ids that match the mutation's predicate. +// That means, if the mutation is applied within a transaction with an isolation level such +// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated +// or updated by the mutation. +func (m *DirectiveExampleMutation) IDs(ctx context.Context) ([]int, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []int{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().DirectiveExample.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetOnTypeField sets the "on_type_field" field. +func (m *DirectiveExampleMutation) SetOnTypeField(s string) { + m.on_type_field = &s +} + +// OnTypeField returns the value of the "on_type_field" field in the mutation. +func (m *DirectiveExampleMutation) OnTypeField() (r string, exists bool) { + v := m.on_type_field + if v == nil { + return + } + return *v, true +} + +// OldOnTypeField returns the old "on_type_field" field's value of the DirectiveExample entity. +// If the DirectiveExample object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DirectiveExampleMutation) OldOnTypeField(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOnTypeField is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOnTypeField requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOnTypeField: %w", err) + } + return oldValue.OnTypeField, nil +} + +// ClearOnTypeField clears the value of the "on_type_field" field. +func (m *DirectiveExampleMutation) ClearOnTypeField() { + m.on_type_field = nil + m.clearedFields[directiveexample.FieldOnTypeField] = struct{}{} +} + +// OnTypeFieldCleared returns if the "on_type_field" field was cleared in this mutation. +func (m *DirectiveExampleMutation) OnTypeFieldCleared() bool { + _, ok := m.clearedFields[directiveexample.FieldOnTypeField] + return ok +} + +// ResetOnTypeField resets all changes to the "on_type_field" field. +func (m *DirectiveExampleMutation) ResetOnTypeField() { + m.on_type_field = nil + delete(m.clearedFields, directiveexample.FieldOnTypeField) +} + +// SetOnMutationFields sets the "on_mutation_fields" field. +func (m *DirectiveExampleMutation) SetOnMutationFields(s string) { + m.on_mutation_fields = &s +} + +// OnMutationFields returns the value of the "on_mutation_fields" field in the mutation. +func (m *DirectiveExampleMutation) OnMutationFields() (r string, exists bool) { + v := m.on_mutation_fields + if v == nil { + return + } + return *v, true +} + +// OldOnMutationFields returns the old "on_mutation_fields" field's value of the DirectiveExample entity. +// If the DirectiveExample object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DirectiveExampleMutation) OldOnMutationFields(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOnMutationFields is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOnMutationFields requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOnMutationFields: %w", err) + } + return oldValue.OnMutationFields, nil +} + +// ClearOnMutationFields clears the value of the "on_mutation_fields" field. +func (m *DirectiveExampleMutation) ClearOnMutationFields() { + m.on_mutation_fields = nil + m.clearedFields[directiveexample.FieldOnMutationFields] = struct{}{} +} + +// OnMutationFieldsCleared returns if the "on_mutation_fields" field was cleared in this mutation. +func (m *DirectiveExampleMutation) OnMutationFieldsCleared() bool { + _, ok := m.clearedFields[directiveexample.FieldOnMutationFields] + return ok +} + +// ResetOnMutationFields resets all changes to the "on_mutation_fields" field. +func (m *DirectiveExampleMutation) ResetOnMutationFields() { + m.on_mutation_fields = nil + delete(m.clearedFields, directiveexample.FieldOnMutationFields) +} + +// SetOnMutationCreate sets the "on_mutation_create" field. +func (m *DirectiveExampleMutation) SetOnMutationCreate(s string) { + m.on_mutation_create = &s +} + +// OnMutationCreate returns the value of the "on_mutation_create" field in the mutation. +func (m *DirectiveExampleMutation) OnMutationCreate() (r string, exists bool) { + v := m.on_mutation_create + if v == nil { + return + } + return *v, true +} + +// OldOnMutationCreate returns the old "on_mutation_create" field's value of the DirectiveExample entity. +// If the DirectiveExample object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DirectiveExampleMutation) OldOnMutationCreate(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOnMutationCreate is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOnMutationCreate requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOnMutationCreate: %w", err) + } + return oldValue.OnMutationCreate, nil +} + +// ClearOnMutationCreate clears the value of the "on_mutation_create" field. +func (m *DirectiveExampleMutation) ClearOnMutationCreate() { + m.on_mutation_create = nil + m.clearedFields[directiveexample.FieldOnMutationCreate] = struct{}{} +} + +// OnMutationCreateCleared returns if the "on_mutation_create" field was cleared in this mutation. +func (m *DirectiveExampleMutation) OnMutationCreateCleared() bool { + _, ok := m.clearedFields[directiveexample.FieldOnMutationCreate] + return ok +} + +// ResetOnMutationCreate resets all changes to the "on_mutation_create" field. +func (m *DirectiveExampleMutation) ResetOnMutationCreate() { + m.on_mutation_create = nil + delete(m.clearedFields, directiveexample.FieldOnMutationCreate) +} + +// SetOnMutationUpdate sets the "on_mutation_update" field. +func (m *DirectiveExampleMutation) SetOnMutationUpdate(s string) { + m.on_mutation_update = &s +} + +// OnMutationUpdate returns the value of the "on_mutation_update" field in the mutation. +func (m *DirectiveExampleMutation) OnMutationUpdate() (r string, exists bool) { + v := m.on_mutation_update + if v == nil { + return + } + return *v, true +} + +// OldOnMutationUpdate returns the old "on_mutation_update" field's value of the DirectiveExample entity. +// If the DirectiveExample object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DirectiveExampleMutation) OldOnMutationUpdate(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOnMutationUpdate is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOnMutationUpdate requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOnMutationUpdate: %w", err) + } + return oldValue.OnMutationUpdate, nil +} + +// ClearOnMutationUpdate clears the value of the "on_mutation_update" field. +func (m *DirectiveExampleMutation) ClearOnMutationUpdate() { + m.on_mutation_update = nil + m.clearedFields[directiveexample.FieldOnMutationUpdate] = struct{}{} +} + +// OnMutationUpdateCleared returns if the "on_mutation_update" field was cleared in this mutation. +func (m *DirectiveExampleMutation) OnMutationUpdateCleared() bool { + _, ok := m.clearedFields[directiveexample.FieldOnMutationUpdate] + return ok +} + +// ResetOnMutationUpdate resets all changes to the "on_mutation_update" field. +func (m *DirectiveExampleMutation) ResetOnMutationUpdate() { + m.on_mutation_update = nil + delete(m.clearedFields, directiveexample.FieldOnMutationUpdate) +} + +// SetOnAllFields sets the "on_all_fields" field. +func (m *DirectiveExampleMutation) SetOnAllFields(s string) { + m.on_all_fields = &s +} + +// OnAllFields returns the value of the "on_all_fields" field in the mutation. +func (m *DirectiveExampleMutation) OnAllFields() (r string, exists bool) { + v := m.on_all_fields + if v == nil { + return + } + return *v, true +} + +// OldOnAllFields returns the old "on_all_fields" field's value of the DirectiveExample entity. +// If the DirectiveExample object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *DirectiveExampleMutation) OldOnAllFields(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOnAllFields is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOnAllFields requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOnAllFields: %w", err) + } + return oldValue.OnAllFields, nil +} + +// ClearOnAllFields clears the value of the "on_all_fields" field. +func (m *DirectiveExampleMutation) ClearOnAllFields() { + m.on_all_fields = nil + m.clearedFields[directiveexample.FieldOnAllFields] = struct{}{} +} + +// OnAllFieldsCleared returns if the "on_all_fields" field was cleared in this mutation. +func (m *DirectiveExampleMutation) OnAllFieldsCleared() bool { + _, ok := m.clearedFields[directiveexample.FieldOnAllFields] + return ok +} + +// ResetOnAllFields resets all changes to the "on_all_fields" field. +func (m *DirectiveExampleMutation) ResetOnAllFields() { + m.on_all_fields = nil + delete(m.clearedFields, directiveexample.FieldOnAllFields) +} + +// Where appends a list predicates to the DirectiveExampleMutation builder. +func (m *DirectiveExampleMutation) Where(ps ...predicate.DirectiveExample) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the DirectiveExampleMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *DirectiveExampleMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.DirectiveExample, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *DirectiveExampleMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *DirectiveExampleMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (DirectiveExample). +func (m *DirectiveExampleMutation) Type() string { + return m.typ +} + +// Fields returns all fields that were changed during this mutation. Note that in +// order to get all numeric fields that were incremented/decremented, call +// AddedFields(). +func (m *DirectiveExampleMutation) Fields() []string { + fields := make([]string, 0, 5) + if m.on_type_field != nil { + fields = append(fields, directiveexample.FieldOnTypeField) + } + if m.on_mutation_fields != nil { + fields = append(fields, directiveexample.FieldOnMutationFields) + } + if m.on_mutation_create != nil { + fields = append(fields, directiveexample.FieldOnMutationCreate) + } + if m.on_mutation_update != nil { + fields = append(fields, directiveexample.FieldOnMutationUpdate) + } + if m.on_all_fields != nil { + fields = append(fields, directiveexample.FieldOnAllFields) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *DirectiveExampleMutation) Field(name string) (ent.Value, bool) { + switch name { + case directiveexample.FieldOnTypeField: + return m.OnTypeField() + case directiveexample.FieldOnMutationFields: + return m.OnMutationFields() + case directiveexample.FieldOnMutationCreate: + return m.OnMutationCreate() + case directiveexample.FieldOnMutationUpdate: + return m.OnMutationUpdate() + case directiveexample.FieldOnAllFields: + return m.OnAllFields() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *DirectiveExampleMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case directiveexample.FieldOnTypeField: + return m.OldOnTypeField(ctx) + case directiveexample.FieldOnMutationFields: + return m.OldOnMutationFields(ctx) + case directiveexample.FieldOnMutationCreate: + return m.OldOnMutationCreate(ctx) + case directiveexample.FieldOnMutationUpdate: + return m.OldOnMutationUpdate(ctx) + case directiveexample.FieldOnAllFields: + return m.OldOnAllFields(ctx) + } + return nil, fmt.Errorf("unknown DirectiveExample field %s", name) +} + +// SetField sets the value of a field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DirectiveExampleMutation) SetField(name string, value ent.Value) error { + switch name { + case directiveexample.FieldOnTypeField: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOnTypeField(v) + return nil + case directiveexample.FieldOnMutationFields: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOnMutationFields(v) + return nil + case directiveexample.FieldOnMutationCreate: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOnMutationCreate(v) + return nil + case directiveexample.FieldOnMutationUpdate: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOnMutationUpdate(v) + return nil + case directiveexample.FieldOnAllFields: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOnAllFields(v) + return nil + } + return fmt.Errorf("unknown DirectiveExample field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *DirectiveExampleMutation) AddedFields() []string { + return nil +} + +// AddedField returns the numeric value that was incremented/decremented on a field +// with the given name. The second boolean return value indicates that this field +// was not set, or was not defined in the schema. +func (m *DirectiveExampleMutation) AddedField(name string) (ent.Value, bool) { + return nil, false +} + +// AddField adds the value to the field with the given name. It returns an error if +// the field is not defined in the schema, or if the type mismatched the field +// type. +func (m *DirectiveExampleMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown DirectiveExample numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *DirectiveExampleMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(directiveexample.FieldOnTypeField) { + fields = append(fields, directiveexample.FieldOnTypeField) + } + if m.FieldCleared(directiveexample.FieldOnMutationFields) { + fields = append(fields, directiveexample.FieldOnMutationFields) + } + if m.FieldCleared(directiveexample.FieldOnMutationCreate) { + fields = append(fields, directiveexample.FieldOnMutationCreate) + } + if m.FieldCleared(directiveexample.FieldOnMutationUpdate) { + fields = append(fields, directiveexample.FieldOnMutationUpdate) + } + if m.FieldCleared(directiveexample.FieldOnAllFields) { + fields = append(fields, directiveexample.FieldOnAllFields) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *DirectiveExampleMutation) FieldCleared(name string) bool { + _, ok := m.clearedFields[name] + return ok +} + +// ClearField clears the value of the field with the given name. It returns an +// error if the field is not defined in the schema. +func (m *DirectiveExampleMutation) ClearField(name string) error { + switch name { + case directiveexample.FieldOnTypeField: + m.ClearOnTypeField() + return nil + case directiveexample.FieldOnMutationFields: + m.ClearOnMutationFields() + return nil + case directiveexample.FieldOnMutationCreate: + m.ClearOnMutationCreate() + return nil + case directiveexample.FieldOnMutationUpdate: + m.ClearOnMutationUpdate() + return nil + case directiveexample.FieldOnAllFields: + m.ClearOnAllFields() + return nil + } + return fmt.Errorf("unknown DirectiveExample nullable field %s", name) +} + +// ResetField resets all changes in the mutation for the field with the given name. +// It returns an error if the field is not defined in the schema. +func (m *DirectiveExampleMutation) ResetField(name string) error { + switch name { + case directiveexample.FieldOnTypeField: + m.ResetOnTypeField() + return nil + case directiveexample.FieldOnMutationFields: + m.ResetOnMutationFields() + return nil + case directiveexample.FieldOnMutationCreate: + m.ResetOnMutationCreate() + return nil + case directiveexample.FieldOnMutationUpdate: + m.ResetOnMutationUpdate() + return nil + case directiveexample.FieldOnAllFields: + m.ResetOnAllFields() + return nil + } + return fmt.Errorf("unknown DirectiveExample field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *DirectiveExampleMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *DirectiveExampleMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *DirectiveExampleMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *DirectiveExampleMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *DirectiveExampleMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *DirectiveExampleMutation) EdgeCleared(name string) bool { + return false +} + +// ClearEdge clears the value of the edge with the given name. It returns an error +// if that edge is not defined in the schema. +func (m *DirectiveExampleMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown DirectiveExample unique edge %s", name) +} + +// ResetEdge resets all changes to the edge with the given name in this mutation. +// It returns an error if the edge is not defined in the schema. +func (m *DirectiveExampleMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown DirectiveExample edge %s", name) +} + // FriendshipMutation represents an operation that mutates the Friendship nodes in the graph. type FriendshipMutation struct { config diff --git a/entgql/internal/todo/ent/predicate/predicate.go b/entgql/internal/todo/ent/predicate/predicate.go index c845c1038..5c63a8825 100644 --- a/entgql/internal/todo/ent/predicate/predicate.go +++ b/entgql/internal/todo/ent/predicate/predicate.go @@ -26,6 +26,9 @@ type BillProduct func(*sql.Selector) // Category is the predicate function for category builders. type Category func(*sql.Selector) +// DirectiveExample is the predicate function for directiveexample builders. +type DirectiveExample func(*sql.Selector) + // Friendship is the predicate function for friendship builders. type Friendship func(*sql.Selector) diff --git a/entgql/internal/todo/ent/schema/directive_example.go b/entgql/internal/todo/ent/schema/directive_example.go new file mode 100644 index 000000000..aa80de2a2 --- /dev/null +++ b/entgql/internal/todo/ent/schema/directive_example.go @@ -0,0 +1,68 @@ +// Copyright 2019-present Facebook +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" +) + +// DirectiveExample holds the schema definition for the DirectiveExample entity. +type DirectiveExample struct { + ent.Schema +} + +func fieldDirective() entgql.Directive { return entgql.NewDirective("fieldDirective") } + +// Fields of the DirectiveExample. +func (DirectiveExample) Fields() []ent.Field { + return []ent.Field{ + field.Text("on_type_field"). + Optional(). + Annotations( + entgql.Directives(fieldDirective()), + ), + field.Text("on_mutation_fields"). + Optional(). + Annotations( + entgql.Directives(fieldDirective().OnCreateMutationField().OnUpdateMutationField().SkipOnTypeField()), + ), + field.Text("on_mutation_create"). + Optional(). + Annotations( + entgql.Directives(fieldDirective().OnCreateMutationField().SkipOnTypeField()), + ), + field.Text("on_mutation_update"). + Optional(). + Annotations( + entgql.Directives(fieldDirective().OnUpdateMutationField().SkipOnTypeField()), + ), + field.Text("on_all_fields"). + Optional(). + Annotations( + entgql.Directives(fieldDirective().OnCreateMutationField().OnUpdateMutationField()), + ), + } +} + +// Annotations returns Todo annotations. +func (DirectiveExample) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), + } +} diff --git a/entgql/internal/todo/ent/tx.go b/entgql/internal/todo/ent/tx.go index b047282f7..7ce39da96 100644 --- a/entgql/internal/todo/ent/tx.go +++ b/entgql/internal/todo/ent/tx.go @@ -30,6 +30,8 @@ type Tx struct { BillProduct *BillProductClient // Category is the client for interacting with the Category builders. Category *CategoryClient + // DirectiveExample is the client for interacting with the DirectiveExample builders. + DirectiveExample *DirectiveExampleClient // Friendship is the client for interacting with the Friendship builders. Friendship *FriendshipClient // Group is the client for interacting with the Group builders. @@ -179,6 +181,7 @@ func (tx *Tx) Client() *Client { func (tx *Tx) init() { tx.BillProduct = NewBillProductClient(tx.config) tx.Category = NewCategoryClient(tx.config) + tx.DirectiveExample = NewDirectiveExampleClient(tx.config) tx.Friendship = NewFriendshipClient(tx.config) tx.Group = NewGroupClient(tx.config) tx.OneToMany = NewOneToManyClient(tx.config) diff --git a/entgql/internal/todo/generated.go b/entgql/internal/todo/generated.go index 24d9cafd4..8facea887 100644 --- a/entgql/internal/todo/generated.go +++ b/entgql/internal/todo/generated.go @@ -57,6 +57,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { + FieldDirective func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) HasPermissions func(ctx context.Context, obj any, next graphql.Resolver, permissions []string) (res any, err error) } @@ -105,6 +106,15 @@ type ComplexityRoot struct { Info func(childComplexity int) int } + DirectiveExample struct { + ID func(childComplexity int) int + OnAllFields func(childComplexity int) int + OnMutationCreate func(childComplexity int) int + OnMutationFields func(childComplexity int) int + OnMutationUpdate func(childComplexity int) int + OnTypeField func(childComplexity int) int + } + Friendship struct { CreatedAt func(childComplexity int) int Friend func(childComplexity int) int @@ -187,16 +197,17 @@ type ComplexityRoot struct { } Query struct { - BillProducts func(childComplexity int) int - Categories func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int - Groups func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.GroupWhereInput) int - Node func(childComplexity int, id int) int - Nodes func(childComplexity int, ids []int) int - OneToMany func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.OneToManyOrder, where *ent.OneToManyWhereInput) int - Ping func(childComplexity int) int - Todos func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - TodosWithJoins func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - Users func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int + BillProducts func(childComplexity int) int + Categories func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int + DirectiveExamples func(childComplexity int) int + Groups func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.GroupWhereInput) int + Node func(childComplexity int, id int) int + Nodes func(childComplexity int, ids []int) int + OneToMany func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.OneToManyOrder, where *ent.OneToManyWhereInput) int + Ping func(childComplexity int) int + Todos func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + TodosWithJoins func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + Users func(childComplexity int, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int } Todo struct { @@ -265,6 +276,7 @@ type QueryResolver interface { Nodes(ctx context.Context, ids []int) ([]ent.Noder, error) BillProducts(ctx context.Context) ([]*ent.BillProduct, error) Categories(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) (*ent.CategoryConnection, error) + DirectiveExamples(ctx context.Context) ([]*ent.DirectiveExample, error) Groups(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) OneToMany(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy *ent.OneToManyOrder, where *ent.OneToManyWhereInput) (*ent.OneToManyConnection, error) Todos(ctx context.Context, after *entgql.Cursor[int], first *int, before *entgql.Cursor[int], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) (*ent.TodoConnection, error) @@ -473,6 +485,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Custom.Info(childComplexity), true + case "DirectiveExample.id": + if e.complexity.DirectiveExample.ID == nil { + break + } + + return e.complexity.DirectiveExample.ID(childComplexity), true + + case "DirectiveExample.onAllFields": + if e.complexity.DirectiveExample.OnAllFields == nil { + break + } + + return e.complexity.DirectiveExample.OnAllFields(childComplexity), true + + case "DirectiveExample.onMutationCreate": + if e.complexity.DirectiveExample.OnMutationCreate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationCreate(childComplexity), true + + case "DirectiveExample.onMutationFields": + if e.complexity.DirectiveExample.OnMutationFields == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationFields(childComplexity), true + + case "DirectiveExample.onMutationUpdate": + if e.complexity.DirectiveExample.OnMutationUpdate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationUpdate(childComplexity), true + + case "DirectiveExample.onTypeField": + if e.complexity.DirectiveExample.OnTypeField == nil { + break + } + + return e.complexity.DirectiveExample.OnTypeField(childComplexity), true + case "Friendship.createdAt": if e.complexity.Friendship.CreatedAt == nil { break @@ -816,6 +870,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Categories(childComplexity, args["after"].(*entgql.Cursor[int]), args["first"].(*int), args["before"].(*entgql.Cursor[int]), args["last"].(*int), args["orderBy"].([]*ent.CategoryOrder), args["where"].(*ent.CategoryWhereInput)), true + case "Query.directiveExamples": + if e.complexity.Query.DirectiveExamples == nil { + break + } + + return e.complexity.Query.DirectiveExamples(childComplexity), true + case "Query.groups": if e.complexity.Query.Groups == nil { break @@ -1165,8 +1226,10 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCategoryTypesInput, ec.unmarshalInputCategoryWhereInput, ec.unmarshalInputCreateCategoryInput, + ec.unmarshalInputCreateDirectiveExampleInput, ec.unmarshalInputCreateTodoInput, ec.unmarshalInputCreateUserInput, + ec.unmarshalInputDirectiveExampleWhereInput, ec.unmarshalInputFriendshipWhereInput, ec.unmarshalInputGroupWhereInput, ec.unmarshalInputOneToManyOrder, @@ -1176,6 +1239,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputTodoOrder, ec.unmarshalInputTodoWhereInput, ec.unmarshalInputUpdateCategoryInput, + ec.unmarshalInputUpdateDirectiveExampleInput, ec.unmarshalInputUpdateFriendshipInput, ec.unmarshalInputUpdateTodoInput, ec.unmarshalInputUpdateUserInput, @@ -4633,8 +4697,8 @@ func (ec *executionContext) fieldContext_Custom_info(_ context.Context, field gr return fc, nil } -func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_id(ctx, field) +func (ec *executionContext) _DirectiveExample_id(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_id(ctx, field) if err != nil { return graphql.Null } @@ -4664,9 +4728,9 @@ func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.Co return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, IsMethod: false, IsResolver: false, @@ -4677,8 +4741,8 @@ func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field return fc, nil } -func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) +func (ec *executionContext) _DirectiveExample_onTypeField(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onTypeField(ctx, field) if err != nil { return graphql.Null } @@ -4690,39 +4754,58 @@ func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnTypeField, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) 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) + res := resTmp.(string) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onTypeField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_userID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationFields(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) if err != nil { return graphql.Null } @@ -4735,38 +4818,35 @@ func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.UserID, nil + return obj.OnMutationFields, 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) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friendID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationCreate(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) if err != nil { return graphql.Null } @@ -4779,38 +4859,35 @@ func (ec *executionContext) _Friendship_friendID(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FriendID, nil + return obj.OnMutationCreate, 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) + res := resTmp.(string) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationCreate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_user(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationUpdate(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) if err != nil { return graphql.Null } @@ -4823,56 +4900,35 @@ func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.User(ctx) + return obj.OnMutationUpdate, 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.(*ent.User) + res := resTmp.(string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationUpdate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friend(ctx, field) +func (ec *executionContext) _DirectiveExample_onAllFields(ctx context.Context, field graphql.CollectedField, obj *ent.DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onAllFields(ctx, field) if err != nil { return graphql.Null } @@ -4884,57 +4940,58 @@ func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Friend(ctx) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnAllFields, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) 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.User) + res := resTmp.(string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onAllFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) +func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_id(ctx, field) if err != nil { return graphql.Null } @@ -4947,41 +5004,38 @@ func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.FriendshipEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendshipEdge(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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_FriendshipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_FriendshipEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) +func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -4994,7 +5048,7 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -5006,36 +5060,26 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.PageInfo[int]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) +func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_userID(ctx, field) if err != nil { return graphql.Null } @@ -5048,7 +5092,7 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.UserID, nil }) if err != nil { ec.Error(ctx, err) @@ -5062,24 +5106,24 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context } res := resTmp.(int) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) +func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friendID(ctx, field) if err != nil { return graphql.Null } @@ -5092,49 +5136,38 @@ func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.FriendID, 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.(*ent.Friendship) + res := resTmp.(int) fc.Result = res - return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", 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_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) +func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_user(ctx, field) if err != nil { return graphql.Null } @@ -5147,7 +5180,7 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.User(ctx) }) if err != nil { ec.Error(ctx, err) @@ -5159,26 +5192,44 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(entgql.Cursor[int]) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_id(ctx, field) +func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friend(ctx, field) if err != nil { return graphql.Null } @@ -5191,7 +5242,7 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Friend(ctx) }) if err != nil { ec.Error(ctx, err) @@ -5203,26 +5254,44 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_name(ctx, field) +func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -5235,38 +5304,41 @@ func (ec *executionContext) _Group_name(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Edges, 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) + res := resTmp.([]*ent.FriendshipEdge) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendshipEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_FriendshipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FriendshipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_users(ctx, field) +func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -5279,7 +5351,7 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -5291,45 +5363,36 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) + 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 UserConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", 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_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) +func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -5342,41 +5405,38 @@ func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.GroupEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipConnection", 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_GroupEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_GroupEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) +func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -5389,48 +5449,49 @@ func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Node, 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[int]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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) + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) }, } return fc, nil } -func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) +func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -5443,7 +5504,7 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -5455,26 +5516,26 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_node(ctx, field) +func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_id(ctx, field) if err != nil { return graphql.Null } @@ -5486,71 +5547,39 @@ func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - directive0 := func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - } - - directive1 := func(ctx context.Context) (any, error) { - permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) - if err != nil { - var zeroVal *ent.Group - return zeroVal, err - } - if ec.directives.HasPermissions == nil { - var zeroVal *ent.Group - return zeroVal, errors.New("directive hasPermissions is not implemented") - } - return ec.directives.HasPermissions(ctx, obj, directive0, permissions) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*ent.Group); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todo/ent.Group`, tmp) + 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.(*ent.Group) + res := resTmp.(int) fc.Result = res - return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroup(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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_Group_id(ctx, field) - case "name": - return ec.fieldContext_Group_name(ctx, field) - case "users": - return ec.fieldContext_Group_users(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) +func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_name(ctx, field) if err != nil { return graphql.Null } @@ -5563,7 +5592,7 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -5575,26 +5604,26 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(entgql.Cursor[int]) + res := resTmp.(string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) +func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_users(ctx, field) if err != nil { return graphql.Null } @@ -5607,7 +5636,7 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) + return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -5619,43 +5648,27 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field } return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Group", Field: field, IsMethod: true, - IsResolver: 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) }, } defer func() { @@ -5665,15 +5678,15 @@ func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) +func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -5686,83 +5699,41 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) + return obj.Edges, 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.(*ent.Todo) + res := resTmp.([]*ent.GroupEdge) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + case "node": + return ec.fieldContext_GroupEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) +func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -5775,7 +5746,7 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(int), fc.Args["input"].(ent.UpdateTodoInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -5787,71 +5758,36 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*ent.Todo) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + 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 Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) +func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -5864,7 +5800,7 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ClearTodos(rctx) + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -5881,12 +5817,12 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, @@ -5894,8 +5830,8 @@ func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, return fc, nil } -func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) +func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -5907,64 +5843,71 @@ func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(int), fc.Args["input"].(ent.UpdateFriendshipInput)) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + } + + directive1 := func(ctx context.Context) (any, error) { + permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) + if err != nil { + var zeroVal *ent.Group + return zeroVal, err + } + if ec.directives.HasPermissions == nil { + var zeroVal *ent.Group + return zeroVal, errors.New("directive hasPermissions is not implemented") + } + return ec.directives.HasPermissions(ctx, obj, directive0, permissions) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*ent.Group); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todo/ent.Group`, tmp) }) 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.Friendship) + res := resTmp.(*ent.Group) fc.Result = res - return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) + return ec.fieldContext_Group_id(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_id(ctx, field) +func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -5977,7 +5920,7 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -5989,26 +5932,26 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "GroupEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_name(ctx, field) +func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) if err != nil { return graphql.Null } @@ -6021,7 +5964,7 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) }) if err != nil { ec.Error(ctx, err) @@ -6033,26 +5976,61 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_field2(ctx, field) +func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) if err != nil { return graphql.Null } @@ -6065,35 +6043,83 @@ func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Field2, nil + return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) }) 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) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_parent(ctx, field) +func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) if err != nil { return graphql.Null } @@ -6106,47 +6132,83 @@ func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent(ctx) + return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(int), fc.Args["input"].(ent.UpdateTodoInput)) }) 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.OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) - }, - } + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_children(ctx, field) +func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) if err != nil { return graphql.Null } @@ -6159,47 +6221,38 @@ func (ec *executionContext) _OneToMany_children(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children(ctx) + return ec.resolvers.Mutation().ClearTodos(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*ent.OneToMany) + res := resTmp.(int) fc.Result = res - return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) +func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) if err != nil { return graphql.Null } @@ -6212,41 +6265,63 @@ func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(int), fc.Args["input"].(ent.UpdateFriendshipInput)) }) 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.OneToManyEdge) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyEdge(ctx, field.Selections, res) + return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "node": - return ec.fieldContext_OneToManyEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_OneToManyEdge_cursor(ctx, field) + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) +func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_id(ctx, field) if err != nil { return graphql.Null } @@ -6259,7 +6334,7 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -6271,36 +6346,26 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f } return graphql.Null } - res := resTmp.(entgql.PageInfo[int]) + res := resTmp.(int) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "OneToMany", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) +func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_name(ctx, field) if err != nil { return graphql.Null } @@ -6313,7 +6378,7 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -6325,26 +6390,26 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "OneToMany", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) +func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_field2(ctx, field) if err != nil { return graphql.Null } @@ -6357,7 +6422,7 @@ func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Field2, nil }) if err != nil { ec.Error(ctx, err) @@ -6366,38 +6431,26 @@ func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.OneToMany) + res := resTmp.(string) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToMany(ctx, field.Selections, res) + return ec.marshalOString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) +func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_parent(ctx, field) if err != nil { return graphql.Null } @@ -6410,38 +6463,47 @@ func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Parent(ctx) }) 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[int]) + res := resTmp.(*ent.OneToMany) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_id(ctx, field) +func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *ent.OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_children(ctx, field) if err != nil { return graphql.Null } @@ -6454,38 +6516,47 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Children(ctx) }) 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) + res := resTmp.([]*ent.OneToMany) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", Field: field, - IsMethod: false, + IsMethod: true, 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 -} + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + }, + } + return fc, nil +} -func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_name(ctx, field) +func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -6498,38 +6569,41 @@ func (ec *executionContext) _Organization_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Edges, 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) + res := resTmp.([]*ent.OneToManyEdge) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToManyConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_OneToManyEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OneToManyEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -6542,7 +6616,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6554,26 +6628,36 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + 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) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -6586,7 +6670,7 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasPreviousPage, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -6598,26 +6682,26 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -6630,7 +6714,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) @@ -6639,26 +6723,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entgql.Cursor[int]) + res := resTmp.(*ent.OneToMany) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) +func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -6671,23 +6767,26 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + 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[int]) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyEdge", Field: field, IsMethod: false, IsResolver: false, @@ -6698,8 +6797,8 @@ func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, f return fc, nil } -func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *ent.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_id(ctx, field) +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_id(ctx, field) if err != nil { return graphql.Null } @@ -6729,9 +6828,9 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Organization", Field: field, IsMethod: false, IsResolver: false, @@ -6742,8 +6841,8 @@ func (ec *executionContext) fieldContext_Project_id(_ context.Context, field gra return fc, nil } -func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *ent.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_todos(ctx, field) +func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_name(ctx, field) if err != nil { return graphql.Null } @@ -6756,7 +6855,7 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Todos(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -6768,45 +6867,26 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Organization", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } 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) +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) if err != nil { return graphql.Null } @@ -6819,46 +6899,38 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Node(rctx, fc.Args["id"].(int)) + 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.(ent.Noder) + res := resTmp.(bool) fc.Result = res - return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_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) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -6871,7 +6943,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]int)) + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -6883,37 +6955,26 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]ent.Noder) + res := resTmp.(bool) fc.Result = res - return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_billProducts(ctx, field) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -6926,48 +6987,35 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().BillProducts(rctx) + return obj.StartCursor, 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.([]*ent.BillProduct) + res := resTmp.(*entgql.Cursor[int]) fc.Result = res - return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductᚄ(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_BillProduct_id(ctx, field) - case "name": - return ec.fieldContext_BillProduct_name(ctx, field) - case "sku": - return ec.fieldContext_BillProduct_sku(ctx, field) - case "quantity": - return ec.fieldContext_BillProduct_quantity(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BillProduct", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } 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) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[int]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -6980,57 +7028,35 @@ func (ec *executionContext) _Query_categories(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.CategoryOrder), fc.Args["where"].(*ent.CategoryWhereInput)) + return obj.EndCursor, 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.(*ent.CategoryConnection) + res := resTmp.(*entgql.Cursor[int]) fc.Result = res - return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, 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) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_categories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_groups(ctx, field) +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *ent.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_id(ctx, field) if err != nil { return graphql.Null } @@ -7043,7 +7069,7 @@ func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7055,45 +7081,26 @@ func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*ent.GroupConnection) + res := resTmp.(int) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_oneToMany(ctx, field) +func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *ent.Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_todos(ctx, field) if err != nil { return graphql.Null } @@ -7106,7 +7113,7 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.OneToManyOrder), fc.Args["where"].(*ent.OneToManyWhereInput)) + return obj.Todos(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7118,27 +7125,27 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*ent.OneToManyConnection) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyConnection(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_OneToManyConnection_edges(ctx, field) + return ec.fieldContext_TodoConnection_edges(ctx, field) case "pageInfo": - return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) + return ec.fieldContext_TodoConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) }, } defer func() { @@ -7148,15 +7155,15 @@ func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, fi } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todos(ctx, field) +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 } @@ -7169,39 +7176,28 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(int)) }) 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.TodoConnection) + res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } defer func() { @@ -7211,15 +7207,15 @@ func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_users(ctx, field) +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 } @@ -7232,7 +7228,7 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]int)) }) if err != nil { ec.Error(ctx, err) @@ -7244,27 +7240,19 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } defer func() { @@ -7274,15 +7262,15 @@ func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ping(ctx, field) +func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_billProducts(ctx, field) if err != nil { return graphql.Null } @@ -7295,7 +7283,7 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ping(rctx) + return ec.resolvers.Query().BillProducts(rctx) }) if err != nil { ec.Error(ctx, err) @@ -7307,26 +7295,36 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*ent.BillProduct) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_billProducts(_ 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("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_BillProduct_id(ctx, field) + case "name": + return ec.fieldContext_BillProduct_name(ctx, field) + case "sku": + return ec.fieldContext_BillProduct_sku(ctx, field) + case "quantity": + return ec.fieldContext_BillProduct_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type BillProduct", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) +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 } @@ -7339,7 +7337,7 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.CategoryOrder), fc.Args["where"].(*ent.CategoryWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7351,12 +7349,12 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.(*ent.CategoryConnection) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -7365,13 +7363,13 @@ func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Contex Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) + return ec.fieldContext_CategoryConnection_edges(ctx, field) case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + return ec.fieldContext_CategoryConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) + return ec.fieldContext_CategoryConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CategoryConnection", field.Name) }, } defer func() { @@ -7381,15 +7379,15 @@ func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_todosWithJoins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _Query_directiveExamples(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_directiveExamples(ctx, field) if err != nil { return graphql.Null } @@ -7402,68 +7400,52 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return ec.resolvers.Query().DirectiveExamples(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]*ent.DirectiveExample) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_directiveExamples(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, 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) + case "id": + return ec.fieldContext_DirectiveExample_id(ctx, field) + case "onTypeField": + return ec.fieldContext_DirectiveExample_onTypeField(ctx, field) + case "onMutationFields": + return ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) + case "onMutationCreate": + return ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) + case "onMutationUpdate": + return ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) + case "onAllFields": + return ec.fieldContext_DirectiveExample_onAllFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DirectiveExample", 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) +func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groups(ctx, field) if err != nil { return graphql.Null } @@ -7476,49 +7458,57 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, 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) + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_id(ctx, field) +func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oneToMany(ctx, field) if err != nil { return graphql.Null } @@ -7531,7 +7521,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.OneToManyOrder), fc.Args["where"].(*ent.OneToManyWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7543,26 +7533,45 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*ent.OneToManyConnection) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐOneToManyConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_OneToManyConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", 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_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_createdAt(ctx, field) +func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todos(ctx, field) if err != nil { return graphql.Null } @@ -7575,7 +7584,7 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7587,26 +7596,45 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_status(ctx, field) +func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_users(ctx, field) if err != nil { return graphql.Null } @@ -7619,7 +7647,7 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7631,26 +7659,45 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(todo.Status) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TodoStatus does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) +func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ping(ctx, field) if err != nil { return graphql.Null } @@ -7663,7 +7710,7 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Priority, nil + return ec.resolvers.Query().Ping(rctx) }) if err != nil { ec.Error(ctx, err) @@ -7675,26 +7722,26 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_text(ctx, field) +func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) if err != nil { return graphql.Null } @@ -7707,7 +7754,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Text, nil + return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7719,26 +7766,45 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todosWithJoins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryID(ctx, field) +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 } @@ -7751,7 +7817,7 @@ func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -7760,26 +7826,59 @@ func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql. if resTmp == nil { return graphql.Null } - res := resTmp.(int) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOID2int(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category_id(ctx, field) + 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 } @@ -7792,7 +7891,7 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) @@ -7801,26 +7900,40 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(int) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalOID2int(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryX(ctx, field) +func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_id(ctx, field) if err != nil { return graphql.Null } @@ -7833,21 +7946,24 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(int) fc.Result = res - return ec.marshalOID2int(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, @@ -7860,8 +7976,8 @@ func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field return fc, nil } -func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_init(ctx, field) +func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -7874,35 +7990,38 @@ func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Init, nil + 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.(map[string]interface{}) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_custom(ctx, field) +func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_status(ctx, field) if err != nil { return graphql.Null } @@ -7915,39 +8034,38 @@ func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Custom, nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]customstruct.Custom) + res := resTmp.(todo.Status) fc.Result = res - return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) + return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type TodoStatus does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_customp(ctx, field) +func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) if err != nil { return graphql.Null } @@ -7960,39 +8078,38 @@ func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Customp, nil + return obj.Priority, 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.([]*customstruct.Custom) + res := resTmp.(int) fc.Result = res - return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_value(ctx, field) +func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_text(ctx, field) if err != nil { return graphql.Null } @@ -8005,7 +8122,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Value, nil + return obj.Text, nil }) if err != nil { ec.Error(ctx, err) @@ -8017,26 +8134,26 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_parent(ctx, field) +func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryID(ctx, field) if err != nil { return graphql.Null } @@ -8049,7 +8166,7 @@ func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent(ctx) + return obj.CategoryID, nil }) if err != nil { ec.Error(ctx, err) @@ -8058,60 +8175,26 @@ func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Todo) + res := resTmp.(int) fc.Result = res - return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalOID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_children(ctx, field) +func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category_id(ctx, field) if err != nil { return graphql.Null } @@ -8124,57 +8207,35 @@ func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.CategoryID, 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.(*ent.TodoConnection) + res := resTmp.(int) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalOID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category(ctx, field) +func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryX(ctx, field) if err != nil { return graphql.Null } @@ -8187,7 +8248,7 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Category(ctx) + return obj.CategoryID, nil }) if err != nil { ec.Error(ctx, err) @@ -8196,50 +8257,26 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(int) fc.Result = res - return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalOID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_extendedField(ctx, field) +func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_init(ctx, field) if err != nil { return graphql.Null } @@ -8252,7 +8289,7 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().ExtendedField(rctx, obj) + return obj.Init, nil }) if err != nil { ec.Error(ctx, err) @@ -8261,26 +8298,26 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) +func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_custom(ctx, field) if err != nil { return graphql.Null } @@ -8293,7 +8330,7 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Custom, nil }) if err != nil { ec.Error(ctx, err) @@ -8302,32 +8339,30 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.TodoEdge) + res := resTmp.([]customstruct.Custom) fc.Result = res - return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoEdge(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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_TodoEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_TodoEdge_cursor(ctx, field) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) +func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_customp(ctx, field) if err != nil { return graphql.Null } @@ -8340,48 +8375,39 @@ func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Customp, 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[int]) + res := resTmp.([]*customstruct.Custom) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) +func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_value(ctx, field) if err != nil { return graphql.Null } @@ -8394,7 +8420,7 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -8411,9 +8437,9 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", Field: field, IsMethod: false, IsResolver: false, @@ -8424,8 +8450,8 @@ func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Con return fc, nil } -func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_node(ctx, field) +func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_parent(ctx, field) if err != nil { return graphql.Null } @@ -8438,7 +8464,7 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Parent(ctx) }) if err != nil { ec.Error(ctx, err) @@ -8452,11 +8478,11 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -8499,8 +8525,8 @@ func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field return fc, nil } -func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) +func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_children(ctx, field) if err != nil { return graphql.Null } @@ -8513,7 +8539,7 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -8525,26 +8551,45 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[int]) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_id(ctx, field) +func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category(ctx, field) if err != nil { return graphql.Null } @@ -8557,38 +8602,59 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Category(ctx) }) 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) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNID2int(ctx, field.Selections, res) + return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_name(ctx, field) +func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_extendedField(ctx, field) if err != nil { return graphql.Null } @@ -8601,29 +8667,26 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Todo().ExtendedField(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -8631,8 +8694,8 @@ func (ec *executionContext) fieldContext_User_name(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_username(ctx, field) +func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -8645,38 +8708,41 @@ func (ec *executionContext) _User_username(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Username, nil + return obj.Edges, 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) + res := resTmp.([]*ent.TodoEdge) fc.Result = res - return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_TodoEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TodoEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) +func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -8689,7 +8755,7 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.RequiredMetadata, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -8701,26 +8767,36 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalNMap2map(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + 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) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_metadata(ctx, field) +func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8733,35 +8809,38 @@ func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Metadata, nil + 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.(map[string]interface{}) + res := resTmp.(int) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_groups(ctx, field) +func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8774,57 +8853,69 @@ func (ec *executionContext) _User_groups(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.Node, 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.(*ent.GroupConnection) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friends(ctx, field) +func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8837,7 +8928,7 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Friends(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8849,45 +8940,26 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friendships(ctx, field) +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) if err != nil { return graphql.Null } @@ -8900,7 +8972,7 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Friendships(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8912,45 +8984,26 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*ent.FriendshipConnection) + res := resTmp.(int) fc.Result = res - return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendshipConnection(ctx, field.Selections, res) + return ec.marshalNID2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "User", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_FriendshipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_edges(ctx, field) +func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_name(ctx, field) if err != nil { return graphql.Null } @@ -8963,41 +9016,38 @@ func (ec *executionContext) _UserConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*ent.UserEdge) + res := resTmp.(string) fc.Result = res - return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserEdge(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", 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_UserEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_UserEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) +func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_username(ctx, field) if err != nil { return graphql.Null } @@ -9010,7 +9060,7 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Username, nil }) if err != nil { ec.Error(ctx, err) @@ -9022,36 +9072,26 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.PageInfo[int]) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", 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 nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) +func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) if err != nil { return graphql.Null } @@ -9064,7 +9104,7 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.RequiredMetadata, nil }) if err != nil { ec.Error(ctx, err) @@ -9076,26 +9116,26 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(int) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_node(ctx, field) +func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(ctx, field) if err != nil { return graphql.Null } @@ -9108,7 +9148,7 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -9117,44 +9157,26 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.User) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", 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_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) +func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groups(ctx, field) if err != nil { return graphql.Null } @@ -9167,7 +9189,7 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9179,26 +9201,45 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[int]) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friends(ctx, field) if err != nil { return graphql.Null } @@ -9211,7 +9252,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Friends(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9223,26 +9264,45 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friendships(ctx, field) if err != nil { return graphql.Null } @@ -9255,35 +9315,57 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Friendships(ctx, fc.Args["after"].(*entgql.Cursor[int]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[int]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) }) 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) + res := resTmp.(*ent.FriendshipConnection) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐFriendshipConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_FriendshipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", 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_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -9296,38 +9378,41 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Edges, 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) + res := resTmp.([]*ent.UserEdge) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUserEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_UserEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -9340,7 +9425,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -9352,36 +9437,36 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(entgql.PageInfo[int]) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "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 __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -9394,7 +9479,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -9406,26 +9491,26 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -9438,38 +9523,53 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Node, 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) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -9482,35 +9582,38 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + 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.(*string) + res := resTmp.(entgql.Cursor[int]) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -9523,7 +9626,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -9535,26 +9638,26 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -9567,7 +9670,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -9581,9 +9684,9 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, IsMethod: true, IsResolver: false, @@ -9594,8 +9697,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -9608,7 +9711,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) @@ -9620,67 +9723,26 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -9710,9 +9772,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, @@ -9733,8 +9795,8 @@ func (ec *executionContext) fieldContext___Field_args(_ context.Context, field g return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -9747,7 +9809,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -9759,48 +9821,26 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -9813,7 +9853,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -9825,26 +9865,26 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) if err != nil { return graphql.Null } @@ -9857,7 +9897,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -9871,9 +9911,9 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -9884,8 +9924,8 @@ func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Con return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -9898,7 +9938,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -9910,26 +9950,26 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__EnumValue", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -9942,7 +9982,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -9956,9 +9996,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -9969,8 +10009,8 @@ func (ec *executionContext) fieldContext___InputValue_description(_ context.Cont return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -9983,7 +10023,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -9995,48 +10035,26 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -10049,7 +10067,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -10063,11 +10081,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -10076,8 +10094,8 @@ func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Con return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) if err != nil { return graphql.Null } @@ -10090,35 +10108,48 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, - IsMethod: true, + 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -10131,7 +10162,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -10143,16 +10174,16 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -10183,8 +10214,8 @@ func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -10197,7 +10228,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -10209,48 +10240,26 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", 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) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -10263,7 +10272,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -10272,48 +10281,26 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", 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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) if err != nil { return graphql.Null } @@ -10326,57 +10313,38 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -10389,50 +10357,35 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -10445,7 +10398,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -10457,26 +10410,48 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -10489,7 +10464,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -10503,11 +10478,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + 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") @@ -10516,8 +10491,8 @@ func (ec *executionContext) fieldContext___Type_name(_ context.Context, field gr return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) if err != nil { return graphql.Null } @@ -10544,9 +10519,9 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -10557,8 +10532,8 @@ func (ec *executionContext) fieldContext___Type_description(_ context.Context, f return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) if err != nil { return graphql.Null } @@ -10571,60 +10546,60 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.Types(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Field_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) + return 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 __Field", field.Name) + 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___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) if err != nil { return graphql.Null } @@ -10637,23 +10612,26 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.QueryType(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -10686,8 +10664,8 @@ func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) if err != nil { return graphql.Null } @@ -10700,7 +10678,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.MutationType(), nil }) if err != nil { ec.Error(ctx, err) @@ -10709,14 +10687,14 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -10749,8 +10727,8 @@ func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } @@ -10763,7 +10741,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.SubscriptionType(), nil }) if err != nil { ec.Error(ctx, err) @@ -10772,47 +10750,104 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___EnumValue_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + return 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 __EnumValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) if err != nil { return graphql.Null } @@ -10825,45 +10860,38 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Kind(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(string) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type __TypeKind does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) if err != nil { return graphql.Null } @@ -10876,7 +10904,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Name(), nil }) if err != nil { ec.Error(ctx, err) @@ -10885,48 +10913,26 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) if err != nil { return graphql.Null } @@ -10939,7 +10945,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -10953,7 +10959,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -10966,18 +10972,854 @@ func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context return fc, nil } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { var it ent.BillProductWhereInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} + 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.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = 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 "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 "sku": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sku = data + case "skuNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuNEQ = data + case "skuIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuIn = data + case "skuNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuNotIn = data + case "skuGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGT = data + case "skuGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGTE = data + case "skuLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLT = data + case "skuLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLTE = data + case "skuContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContains = data + case "skuHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasPrefix = data + case "skuHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasSuffix = data + case "skuEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuEqualFold = data + case "skuContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContainsFold = data + case "quantity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.Quantity = data + case "quantityNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityNEQ = data + case "quantityIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityIn = data + case "quantityNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityNotIn = data + case "quantityGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGT = data + case "quantityGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGTE = data + case "quantityLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLT = data + case "quantityLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLTE = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { + var it schematype.CategoryConfig + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"maxMembers"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "maxMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) + data, err := ec.unmarshalOInt2int(ctx, v) + if err != nil { + return it, err + } + it.MaxMembers = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { + var it ent.CategoryOrder + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + 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ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (schematype.CategoryTypes, error) { + var it schematype.CategoryTypes + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"public"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "public": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Public = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { + var it ent.CategoryWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -10986,425 +11828,802 @@ func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Cont switch k { case "not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInput(ctx, v) + data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋ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ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "textNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextNEQ = data + case "textIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextIn = data + case "textNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextNotIn = data + case "textGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGT = data + case "textGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGTE = data + case "textLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLT = data + case "textLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLTE = data + case "textContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContains = data + case "textHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasPrefix = data + case "textHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasSuffix = data + case "textEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextEqualFold = data + case "textContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatusᚄ(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatusᚄ(ctx, v) if err != nil { return it, err } - it.Or = data - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.StatusNotIn = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.ID = data - case "idNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.Config = data + case "configNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDNEQ = data - case "idIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.ConfigNEQ = data + case "configIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) if err != nil { return it, err } - it.IDIn = data - case "idNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.ConfigIn = data + case "configNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) if err != nil { return it, err } - it.IDNotIn = data - case "idGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.ConfigNotIn = data + case "configGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDGT = data - case "idGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.ConfigGT = data + case "configGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDGTE = data - case "idLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.ConfigGTE = data + case "configLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDLT = data - case "idLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.ConfigLT = data + case "configLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.ConfigLTE = data + case "configIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigIsNil = data + case "configNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigNotNil = data + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.Duration = data + case "durationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationNEQ = data + case "durationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationIn = data + case "durationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationNotIn = data + case "durationGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationGT = data + case "durationGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationGTE = data + case "durationLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationLT = data + case "durationLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationLTE = data + case "durationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationIsNil = data + case "durationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.DurationNotNil = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "sku": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Count = data + case "countNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.Sku = data - case "skuNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountNEQ = data + case "countIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountIn = data + case "countNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountNotIn = data + case "countGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGT = data + case "countGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGTE = data + case "countLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountLT = data + case "countLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountLTE = data + case "countIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CountIsNil = data + case "countNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CountNotNil = data + case "hasTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuNEQ = data - case "skuIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.HasTodos = data + case "hasTodosWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) + data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuIn = data - case "skuNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.HasTodosWith = data + case "hasSubCategories": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuNotIn = data - case "skuGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategories = data + case "hasSubCategoriesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) + data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuGT = data - case "skuGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategoriesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { + var it ent.CreateCategoryInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.SkuGTE = data - case "skuLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Text = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.SkuLT = data - case "skuLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Status = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.SkuLTE = data - case "skuContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Config = data + case "types": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) + data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryTypes(ctx, v) if err != nil { return it, err } - it.SkuContains = data - case "skuHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Types = data + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.SkuHasPrefix = data - case "skuHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Duration = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.SkuHasSuffix = data - case "skuEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Count = data + case "strings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.SkuEqualFold = data - case "skuContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Strings = data + case "todoIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { return it, err } - it.SkuContainsFold = data - case "quantity": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.TodoIDs = data + case "subCategoryIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) if err != nil { return it, err } - it.Quantity = data - case "quantityNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.SubCategoryIDs = data + case "createTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) + data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCreateTodoInputᚄ(ctx, v) if err != nil { return it, err } - it.QuantityNEQ = data - case "quantityIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) - if err != nil { + if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { return it, err } - it.QuantityIn = data - case "quantityNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateDirectiveExampleInput(ctx context.Context, obj any) (ent.CreateDirectiveExampleInput, error) { + var it ent.CreateDirectiveExampleInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"onTypeField", "onMutationFields", "onMutationCreate", "onMutationUpdate", "onAllFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.QuantityNotIn = data - case "quantityGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } - it.QuantityGT = data - case "quantityGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } - it.QuantityGTE = data - case "quantityLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if data, ok := tmp.(*string); ok { + it.OnMutationCreate = data + } else if tmp == nil { + it.OnMutationCreate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.QuantityLT = data - case "quantityLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationUpdate = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) } - it.QuantityLTE = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { - var it schematype.CategoryConfig +func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { + var it ent.CreateTodoInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"maxMembers"} + fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "maxMembers": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) - data, err := ec.unmarshalOInt2int(ctx, v) + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "priority": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Priority = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "init": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Init = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Value = data + case "parentID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ParentID = data + case "childIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.ChildIDs = data + case "categoryID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) if err != nil { return it, err } - it.MaxMembers = data + it.CategoryID = data + case "secretID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) + data, err := ec.unmarshalOID2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SecretID = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { - var it ent.CategoryOrder +func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { + var it ent.CreateUserInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} + fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} 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) + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Direction = data - case "field": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNCategoryOrderField2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryOrderField(ctx, v) + it.Name = data + case "username": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + data, err := ec.unmarshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) if err != nil { return it, err } - it.Field = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (schematype.CategoryTypes, error) { - var it schematype.CategoryTypes - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"public"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "public": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.Username = data + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Public = data + it.Password = data + case "requiredMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) + data, err := ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + it.RequiredMetadata = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "friendIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) + data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FriendIDs = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { - var it ent.CategoryWhereInput +func (ec *executionContext) unmarshalInputDirectiveExampleWhereInput(ctx context.Context, obj any) (ent.DirectiveExampleWhereInput, error) { + var it ent.DirectiveExampleWhereInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "onTypeField", "onTypeFieldNEQ", "onTypeFieldIn", "onTypeFieldNotIn", "onTypeFieldGT", "onTypeFieldGTE", "onTypeFieldLT", "onTypeFieldLTE", "onTypeFieldContains", "onTypeFieldHasPrefix", "onTypeFieldHasSuffix", "onTypeFieldIsNil", "onTypeFieldNotNil", "onTypeFieldEqualFold", "onTypeFieldContainsFold", "onMutationFields", "onMutationFieldsNEQ", "onMutationFieldsIn", "onMutationFieldsNotIn", "onMutationFieldsGT", "onMutationFieldsGTE", "onMutationFieldsLT", "onMutationFieldsLTE", "onMutationFieldsContains", "onMutationFieldsHasPrefix", "onMutationFieldsHasSuffix", "onMutationFieldsIsNil", "onMutationFieldsNotNil", "onMutationFieldsEqualFold", "onMutationFieldsContainsFold", "onMutationCreate", "onMutationCreateNEQ", "onMutationCreateIn", "onMutationCreateNotIn", "onMutationCreateGT", "onMutationCreateGTE", "onMutationCreateLT", "onMutationCreateLTE", "onMutationCreateContains", "onMutationCreateHasPrefix", "onMutationCreateHasSuffix", "onMutationCreateIsNil", "onMutationCreateNotNil", "onMutationCreateEqualFold", "onMutationCreateContainsFold", "onMutationUpdate", "onMutationUpdateNEQ", "onMutationUpdateIn", "onMutationUpdateNotIn", "onMutationUpdateGT", "onMutationUpdateGTE", "onMutationUpdateLT", "onMutationUpdateLTE", "onMutationUpdateContains", "onMutationUpdateHasPrefix", "onMutationUpdateHasSuffix", "onMutationUpdateIsNil", "onMutationUpdateNotNil", "onMutationUpdateEqualFold", "onMutationUpdateContainsFold", "onAllFields", "onAllFieldsNEQ", "onAllFieldsIn", "onAllFieldsNotIn", "onAllFieldsGT", "onAllFieldsGTE", "onAllFieldsLT", "onAllFieldsLTE", "onAllFieldsContains", "onAllFieldsHasPrefix", "onAllFieldsHasSuffix", "onAllFieldsIsNil", "onAllFieldsNotNil", "onAllFieldsEqualFold", "onAllFieldsContainsFold"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -11413,21 +12632,21 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context switch k { case "not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryWhereInput(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInput(ctx, v) if err != nil { return it, err } it.Not = data case "and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } it.And = data case "or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -11488,607 +12707,531 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context return it, err } it.IDLTE = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Text = data - case "textNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + it.OnTypeField = data + case "onTypeFieldNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextNEQ = data - case "textIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + it.OnTypeFieldNEQ = data + case "onTypeFieldIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextIn = data - case "textNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + it.OnTypeFieldIn = data + case "onTypeFieldNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextNotIn = data - case "textGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGT = data - case "textGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGTE = data - case "textLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + it.OnTypeFieldNotIn = data + case "onTypeFieldGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLT = data - case "textLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + it.OnTypeFieldGT = data + case "onTypeFieldGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLTE = data - case "textContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + it.OnTypeFieldGTE = data + case "onTypeFieldLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContains = data - case "textHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + it.OnTypeFieldLT = data + case "onTypeFieldLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasPrefix = data - case "textHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + it.OnTypeFieldLTE = data + case "onTypeFieldContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasSuffix = data - case "textEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + it.OnTypeFieldContains = data + case "onTypeFieldHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextEqualFold = data - case "textContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + it.OnTypeFieldHasPrefix = data + case "onTypeFieldHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContainsFold = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.Status = data - case "statusNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.StatusNEQ = data - case "statusIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusIn = data - case "statusNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusNotIn = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.Config = data - case "configNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.ConfigNEQ = data - case "configIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) - if err != nil { - return it, err - } - it.ConfigIn = data - case "configNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) + it.OnTypeFieldHasSuffix = data + case "onTypeFieldIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.ConfigNotIn = data - case "configGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldIsNil = data + case "onTypeFieldNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.ConfigGT = data - case "configGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldNotNil = data + case "onTypeFieldEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigGTE = data - case "configLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldEqualFold = data + case "onTypeFieldContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLT = data - case "configLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldContainsFold = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLTE = data - case "configIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFields = data + case "onMutationFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigIsNil = data - case "configNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsNEQ = data + case "onMutationFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.ConfigNotNil = data - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsIn = data + case "onMutationFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Duration = data - case "durationNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsNotIn = data + case "onMutationFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNEQ = data - case "durationIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGT = data + case "onMutationFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationIn = data - case "durationNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGTE = data + case "onMutationFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNotIn = data - case "durationGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLT = data + case "onMutationFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGT = data - case "durationGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLTE = data + case "onMutationFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGTE = data - case "durationLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsContains = data + case "onMutationFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLT = data - case "durationLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsHasPrefix = data + case "onMutationFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLTE = data - case "durationIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) + it.OnMutationFieldsHasSuffix = data + case "onMutationFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIsNil")) data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.DurationIsNil = data - case "durationNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) + it.OnMutationFieldsIsNil = data + case "onMutationFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotNil")) data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.DurationNotNil = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsNotNil = data + case "onMutationFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Count = data - case "countNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsEqualFold = data + case "onMutationFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNEQ = data - case "countIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationFieldsContainsFold = data + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIn = data - case "countNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationCreate = data + case "onMutationCreateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotIn = data - case "countGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNEQ = data + case "onMutationCreateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGT = data - case "countGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateIn = data + case "onMutationCreateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGTE = data - case "countLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNotIn = data + case "onMutationCreateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLT = data - case "countLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateGT = data + case "onMutationCreateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLTE = data - case "countIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateGTE = data + case "onMutationCreateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIsNil = data - case "countNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateLT = data + case "onMutationCreateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotNil = data - case "hasTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateLTE = data + case "onMutationCreateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodos = data - case "hasTodosWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) - data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐTodoWhereInputᚄ(ctx, v) + it.OnMutationCreateContains = data + case "onMutationCreateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodosWith = data - case "hasSubCategories": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateHasPrefix = data + case "onMutationCreateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasSubCategories = data - case "hasSubCategoriesWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCategoryWhereInputᚄ(ctx, v) + it.OnMutationCreateHasSuffix = data + case "onMutationCreateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.HasSubCategoriesWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { - var it ent.CreateCategoryInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationCreateIsNil = data + case "onMutationCreateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.Text = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋcategoryᚐStatus(ctx, v) + it.OnMutationCreateNotNil = data + case "onMutationCreateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Status = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnMutationCreateEqualFold = data + case "onMutationCreateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Config = data - case "types": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) - data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryTypes(ctx, v) + it.OnMutationCreateContainsFold = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Types = data - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationUpdate = data + case "onMutationUpdateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Duration = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationUpdateNEQ = data + case "onMutationUpdateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Count = data - case "strings": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) + it.OnMutationUpdateIn = data + case "onMutationUpdateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Strings = data - case "todoIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.OnMutationUpdateNotIn = data + case "onMutationUpdateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TodoIDs = data - case "subCategoryIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.OnMutationUpdateGT = data + case "onMutationUpdateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SubCategoryIDs = data - case "createTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) - data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐCreateTodoInputᚄ(ctx, v) + it.OnMutationUpdateGTE = data + case "onMutationUpdateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { + it.OnMutationUpdateLT = data + case "onMutationUpdateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { - var it ent.CreateTodoInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + it.OnMutationUpdateLTE = data + case "onMutationUpdateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Status = data - case "priority": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateContains = data + case "onMutationUpdateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Priority = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationUpdateHasPrefix = data + case "onMutationUpdateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Text = data - case "init": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnMutationUpdateHasSuffix = data + case "onMutationUpdateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.Init = data - case "value": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateIsNil = data + case "onMutationUpdateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.Value = data - case "parentID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.OnMutationUpdateNotNil = data + case "onMutationUpdateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ParentID = data - case "childIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.OnMutationUpdateEqualFold = data + case "onMutationUpdateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ChildIDs = data - case "categoryID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.OnMutationUpdateContainsFold = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CategoryID = data - case "secretID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) - data, err := ec.unmarshalOID2ᚖint(ctx, v) + it.OnAllFields = data + case "onAllFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SecretID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { - var it ent.CreateUserInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.OnAllFieldsNEQ = data + case "onAllFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsIn = data + case "onAllFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsNotIn = data + case "onAllFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsGT = data + case "onAllFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "username": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) - data, err := ec.unmarshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.OnAllFieldsGTE = data + case "onAllFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Username = data - case "password": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + it.OnAllFieldsLT = data + case "onAllFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Password = data - case "requiredMetadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) - data, err := ec.unmarshalNMap2map(ctx, v) + it.OnAllFieldsLTE = data + case "onAllFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.RequiredMetadata = data - case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnAllFieldsContains = data + case "onAllFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Metadata = data - case "groupIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.OnAllFieldsHasPrefix = data + case "onAllFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GroupIDs = data - case "friendIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) - data, err := ec.unmarshalOID2ᚕintᚄ(ctx, v) + it.OnAllFieldsHasSuffix = data + case "onAllFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.FriendIDs = data + it.OnAllFieldsIsNil = data + case "onAllFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsNotNil = data + case "onAllFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsEqualFold = data + case "onAllFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsContainsFold = data } } @@ -13776,6 +14919,192 @@ func (ec *executionContext) unmarshalInputUpdateCategoryInput(ctx context.Contex return it, nil } +func (ec *executionContext) unmarshalInputUpdateDirectiveExampleInput(ctx context.Context, obj any) (ent.UpdateDirectiveExampleInput, error) { + var it ent.UpdateDirectiveExampleInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"onTypeField", "clearOnTypeField", "onMutationFields", "clearOnMutationFields", "onMutationCreate", "clearOnMutationCreate", "onMutationUpdate", "clearOnMutationUpdate", "onAllFields", "clearOnAllFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeField = data + case "clearOnTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnTypeField")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2bool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(bool); ok { + it.ClearOnMutationFields = data + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreate = data + case "clearOnMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationCreate")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnMutationCreate = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationUpdate = data + } else if tmp == nil { + it.OnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2bool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(bool); ok { + it.ClearOnMutationUpdate = data + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2bool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(bool); ok { + it.ClearOnAllFields = data + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputUpdateFriendshipInput(ctx context.Context, obj any) (ent.UpdateFriendshipInput, error) { var it ent.UpdateFriendshipInput asMap := map[string]any{} @@ -14400,6 +15729,11 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Category(ctx, sel, obj) + case *ent.DirectiveExample: + if obj == nil { + return graphql.Null + } + return ec._DirectiveExample(ctx, sel, obj) case *ent.Friendship: if obj == nil { return graphql.Null @@ -14855,6 +16189,55 @@ func (ec *executionContext) _Custom(ctx context.Context, sel ast.SelectionSet, o return out } +var directiveExampleImplementors = []string{"DirectiveExample", "Node"} + +func (ec *executionContext) _DirectiveExample(ctx context.Context, sel ast.SelectionSet, obj *ent.DirectiveExample) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, directiveExampleImplementors) + + 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("DirectiveExample") + case "id": + out.Values[i] = ec._DirectiveExample_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "onTypeField": + out.Values[i] = ec._DirectiveExample_onTypeField(ctx, field, obj) + case "onMutationFields": + out.Values[i] = ec._DirectiveExample_onMutationFields(ctx, field, obj) + case "onMutationCreate": + out.Values[i] = ec._DirectiveExample_onMutationCreate(ctx, field, obj) + case "onMutationUpdate": + out.Values[i] = ec._DirectiveExample_onMutationUpdate(ctx, field, obj) + case "onAllFields": + out.Values[i] = ec._DirectiveExample_onAllFields(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 friendshipImplementors = []string{"Friendship", "Node"} func (ec *executionContext) _Friendship(ctx context.Context, sel ast.SelectionSet, obj *ent.Friendship) graphql.Marshaler { @@ -15781,6 +17164,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "directiveExamples": + 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_directiveExamples(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 "groups": field := field @@ -16992,6 +18397,65 @@ func (ec *executionContext) marshalNCustom2entgoᚗioᚋcontribᚋentgqlᚋinter return ec._Custom(ctx, sel, &v) } +func (ec *executionContext) marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleᚄ(ctx context.Context, sel ast.SelectionSet, v []*ent.DirectiveExample) 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.marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExample(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExample(ctx context.Context, sel ast.SelectionSet, v *ent.DirectiveExample) 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._DirectiveExample(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*ent.DirectiveExampleWhereInput, error) { + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNDuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) @@ -18130,6 +19594,34 @@ func (ec *executionContext) marshalOCustom2ᚖentgoᚗioᚋcontribᚋentgqlᚋin return ec._Custom(ctx, sel, v) } +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInputᚄ(ctx context.Context, v any) ([]*ent.DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []any + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*ent.DirectiveExampleWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*ent.DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalODuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/entgql/internal/todo/resolver.go b/entgql/internal/todo/resolver.go index 26e2e01d4..cdf04dd51 100644 --- a/entgql/internal/todo/resolver.go +++ b/entgql/internal/todo/resolver.go @@ -15,6 +15,8 @@ package todo import ( + "context" + "entgo.io/contrib/entgql/internal/todo/ent" "github.com/99designs/gqlgen/graphql" ) @@ -28,6 +30,9 @@ func NewSchema(client *ent.Client) graphql.ExecutableSchema { Resolvers: &Resolver{client}, Directives: DirectiveRoot{ HasPermissions: HasPermission(), + FieldDirective: func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) { + return next(ctx) + }, }, }) } diff --git a/entgql/internal/todo/todo.graphql b/entgql/internal/todo/todo.graphql index 12d192821..cce3b0e6f 100644 --- a/entgql/internal/todo/todo.graphql +++ b/entgql/internal/todo/todo.graphql @@ -1,4 +1,5 @@ directive @hasPermissions(permissions: [String!]!) on OBJECT | FIELD_DEFINITION +directive @fieldDirective on FIELD_DEFINITION | INPUT_FIELD_DEFINITION type CategoryConfig { maxMembers: Int @@ -80,4 +81,4 @@ extend input CreateCategoryInput { interface NamedNode { name: String! -} \ No newline at end of file +} diff --git a/entgql/internal/todo/todo_test.go b/entgql/internal/todo/todo_test.go index 7e2136c7b..233fc366f 100644 --- a/entgql/internal/todo/todo_test.go +++ b/entgql/internal/todo/todo_test.go @@ -75,7 +75,7 @@ const ( } }` maxTodos = 32 - idOffset = 6 << 32 + idOffset = 7 << 32 ) func (s *todoTestSuite) SetupTest() { @@ -1685,13 +1685,40 @@ func TestNestedConnection(t *testing.T) { } } ) + allUsersQuery := `query ($id: ID!) { + group: node(id: $id) { + ... on Group { + name + users { + edges { + cursor + } + } + } + } + }` + var allUsersRes struct { + Group struct { + Name string + Users struct { + Edges []struct { + Cursor string + } + } + } + } + gid := groups[0].ID + err = gqlc.Post(allUsersQuery, &allUsersRes, client.Var("id", gid)) + require.NoError(t, err) + + edgeIdx := len(allUsersRes.Group.Users.Edges) - 1 err = gqlc.Post(query, &rsp, - client.Var("id", groups[0].ID), - client.Var("cursor", "gaFpzwAAAAcAAAAJ"), + client.Var("id", gid), + client.Var("cursor", allUsersRes.Group.Users.Edges[edgeIdx].Cursor), ) require.NoError(t, err) require.Equal(t, 1, len(rsp.Group.Users.Edges)) - require.Equal(t, "gaFpzwAAAAcAAAAI", rsp.Group.Users.Edges[0].Cursor) + require.Equal(t, allUsersRes.Group.Users.Edges[edgeIdx-1].Cursor, rsp.Group.Users.Edges[0].Cursor) }) } diff --git a/entgql/internal/todogotype/ent.resolvers.go b/entgql/internal/todogotype/ent.resolvers.go index e8e81db38..1fa03cd3b 100644 --- a/entgql/internal/todogotype/ent.resolvers.go +++ b/entgql/internal/todogotype/ent.resolvers.go @@ -58,6 +58,11 @@ func (r *queryResolver) Categories(ctx context.Context, after *entgql.Cursor[str panic(fmt.Errorf("not implemented")) } +// DirectiveExamples is the resolver for the directiveExamples field. +func (r *queryResolver) DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) { + panic(fmt.Errorf("not implemented: DirectiveExamples - directiveExamples")) +} + // Groups is the resolver for the groups field. func (r *queryResolver) Groups(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) { panic(fmt.Errorf("not implemented")) diff --git a/entgql/internal/todogotype/generated.go b/entgql/internal/todogotype/generated.go index 0e24fdf15..b92ecdddc 100644 --- a/entgql/internal/todogotype/generated.go +++ b/entgql/internal/todogotype/generated.go @@ -62,6 +62,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { + FieldDirective func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) HasPermissions func(ctx context.Context, obj any, next graphql.Resolver, permissions []string) (res any, err error) } @@ -110,6 +111,15 @@ type ComplexityRoot struct { Info func(childComplexity int) int } + DirectiveExample struct { + ID func(childComplexity int) int + OnAllFields func(childComplexity int) int + OnMutationCreate func(childComplexity int) int + OnMutationFields func(childComplexity int) int + OnMutationUpdate func(childComplexity int) int + OnTypeField func(childComplexity int) int + } + Friendship struct { CreatedAt func(childComplexity int) int Friend func(childComplexity int) int @@ -192,16 +202,17 @@ type ComplexityRoot struct { } Query struct { - BillProducts func(childComplexity int) int - Categories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int - Groups func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *ent.GroupWhereInput) int - Node func(childComplexity int, id string) int - Nodes func(childComplexity int, ids []string) int - OneToMany func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int - Ping func(childComplexity int) int - Todos func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - TodosWithJoins func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - Users func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int + BillProducts func(childComplexity int) int + Categories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int + DirectiveExamples func(childComplexity int) int + Groups func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *ent.GroupWhereInput) int + Node func(childComplexity int, id string) int + Nodes func(childComplexity int, ids []string) int + OneToMany func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int + Ping func(childComplexity int) int + Todos func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + TodosWithJoins func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + Users func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int } Todo struct { @@ -275,6 +286,7 @@ type QueryResolver interface { Nodes(ctx context.Context, ids []string) ([]ent.Noder, error) BillProducts(ctx context.Context) ([]*ent.BillProduct, error) Categories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) (*ent.CategoryConnection, error) + DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) Groups(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) OneToMany(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) (*OneToManyConnection, error) Todos(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) (*ent.TodoConnection, error) @@ -519,6 +531,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Custom.Info(childComplexity), true + case "DirectiveExample.id": + if e.complexity.DirectiveExample.ID == nil { + break + } + + return e.complexity.DirectiveExample.ID(childComplexity), true + + case "DirectiveExample.onAllFields": + if e.complexity.DirectiveExample.OnAllFields == nil { + break + } + + return e.complexity.DirectiveExample.OnAllFields(childComplexity), true + + case "DirectiveExample.onMutationCreate": + if e.complexity.DirectiveExample.OnMutationCreate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationCreate(childComplexity), true + + case "DirectiveExample.onMutationFields": + if e.complexity.DirectiveExample.OnMutationFields == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationFields(childComplexity), true + + case "DirectiveExample.onMutationUpdate": + if e.complexity.DirectiveExample.OnMutationUpdate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationUpdate(childComplexity), true + + case "DirectiveExample.onTypeField": + if e.complexity.DirectiveExample.OnTypeField == nil { + break + } + + return e.complexity.DirectiveExample.OnTypeField(childComplexity), true + case "Friendship.createdAt": if e.complexity.Friendship.CreatedAt == nil { break @@ -862,6 +916,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Categories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].([]*ent.CategoryOrder), args["where"].(*ent.CategoryWhereInput)), true + case "Query.directiveExamples": + if e.complexity.Query.DirectiveExamples == nil { + break + } + + return e.complexity.Query.DirectiveExamples(childComplexity), true + case "Query.groups": if e.complexity.Query.Groups == nil { break @@ -1211,8 +1272,10 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCategoryTypesInput, ec.unmarshalInputCategoryWhereInput, ec.unmarshalInputCreateCategoryInput, + ec.unmarshalInputCreateDirectiveExampleInput, ec.unmarshalInputCreateTodoInput, ec.unmarshalInputCreateUserInput, + ec.unmarshalInputDirectiveExampleWhereInput, ec.unmarshalInputFriendshipWhereInput, ec.unmarshalInputGroupWhereInput, ec.unmarshalInputOneToManyOrder, @@ -1222,6 +1285,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputTodoOrder, ec.unmarshalInputTodoWhereInput, ec.unmarshalInputUpdateCategoryInput, + ec.unmarshalInputUpdateDirectiveExampleInput, ec.unmarshalInputUpdateFriendshipInput, ec.unmarshalInputUpdateTodoInput, ec.unmarshalInputUpdateUserInput, @@ -1325,6 +1389,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "../todo/todo.graphql", Input: `directive @hasPermissions(permissions: [String!]!) on OBJECT | FIELD_DEFINITION +directive @fieldDirective on FIELD_DEFINITION | INPUT_FIELD_DEFINITION type CategoryConfig { maxMembers: Int @@ -1406,7 +1471,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! -}`, BuiltIn: false}, +} +`, BuiltIn: false}, {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { @@ -1719,6 +1785,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -1751,6 +1828,124 @@ Define a Relay Cursor type: https://relay.dev/graphql/connections.htm#sec-Cursor """ scalar Cursor +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -2245,6 +2440,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -2612,6 +2808,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ @@ -6202,8 +6414,8 @@ func (ec *executionContext) fieldContext_Custom_info(_ context.Context, field gr return fc, nil } -func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_id(ctx, field) +func (ec *executionContext) _DirectiveExample_id(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_id(ctx, field) if err != nil { return graphql.Null } @@ -6233,9 +6445,9 @@ func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.Co return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, IsMethod: false, IsResolver: false, @@ -6246,8 +6458,8 @@ func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field return fc, nil } -func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) +func (ec *executionContext) _DirectiveExample_onTypeField(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onTypeField(ctx, field) if err != nil { return graphql.Null } @@ -6259,39 +6471,58 @@ func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnTypeField, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onTypeField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_userID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) if err != nil { return graphql.Null } @@ -6304,38 +6535,35 @@ func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.UserID, nil + return obj.OnMutationFields, 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friendID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationCreate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) if err != nil { return graphql.Null } @@ -6348,38 +6576,35 @@ func (ec *executionContext) _Friendship_friendID(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FriendID, nil + return obj.OnMutationCreate, 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationCreate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_user(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationUpdate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) if err != nil { return graphql.Null } @@ -6392,56 +6617,35 @@ func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.User(ctx) + return obj.OnMutationUpdate, 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.(*ent.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationUpdate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friend(ctx, field) +func (ec *executionContext) _DirectiveExample_onAllFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onAllFields(ctx, field) if err != nil { return graphql.Null } @@ -6453,57 +6657,58 @@ func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Friend(ctx) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnAllFields, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onAllFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) +func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_id(ctx, field) if err != nil { return graphql.Null } @@ -6516,41 +6721,38 @@ func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.FriendshipEdge) + res := resTmp.(string) fc.Result = res - return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendshipEdge(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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_FriendshipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_FriendshipEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) +func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -6563,7 +6765,7 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -6575,36 +6777,26 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.PageInfo[string]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) +func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_userID(ctx, field) if err != nil { return graphql.Null } @@ -6617,7 +6809,7 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.UserID, nil }) if err != nil { ec.Error(ctx, err) @@ -6629,26 +6821,26 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) +func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friendID(ctx, field) if err != nil { return graphql.Null } @@ -6661,49 +6853,38 @@ func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.FriendID, 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.(*ent.Friendship) + res := resTmp.(string) fc.Result = res - return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", 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_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) +func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_user(ctx, field) if err != nil { return graphql.Null } @@ -6716,7 +6897,7 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.User(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6728,26 +6909,44 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(entgql.Cursor[string]) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_id(ctx, field) +func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friend(ctx, field) if err != nil { return graphql.Null } @@ -6760,7 +6959,7 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Friend(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6772,26 +6971,44 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_name(ctx, field) +func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -6804,38 +7021,41 @@ func (ec *executionContext) _Group_name(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Edges, 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) + res := resTmp.([]*ent.FriendshipEdge) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendshipEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_FriendshipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FriendshipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_users(ctx, field) +func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -6848,7 +7068,7 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6860,45 +7080,36 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.PageInfo[string]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) + 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 UserConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", 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_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) +func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -6911,41 +7122,38 @@ func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.GroupEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipConnection", 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_GroupEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_GroupEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) +func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -6958,48 +7166,49 @@ func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Node, 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[string]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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) - }, - } + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + }, + } return fc, nil } -func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) +func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7012,7 +7221,7 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7024,26 +7233,26 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[string]) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_node(ctx, field) +func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_id(ctx, field) if err != nil { return graphql.Null } @@ -7055,71 +7264,39 @@ func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - directive0 := func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - } - - directive1 := func(ctx context.Context) (any, error) { - permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) - if err != nil { - var zeroVal *ent.Group - return zeroVal, err - } - if ec.directives.HasPermissions == nil { - var zeroVal *ent.Group - return zeroVal, errors.New("directive hasPermissions is not implemented") - } - return ec.directives.HasPermissions(ctx, obj, directive0, permissions) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*ent.Group); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todogotype/ent.Group`, tmp) + 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.(*ent.Group) + res := resTmp.(string) fc.Result = res - return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroup(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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_Group_id(ctx, field) - case "name": - return ec.fieldContext_Group_name(ctx, field) - case "users": - return ec.fieldContext_Group_users(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) +func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_name(ctx, field) if err != nil { return graphql.Null } @@ -7132,7 +7309,7 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -7144,26 +7321,26 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(entgql.Cursor[string]) + res := resTmp.(string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) +func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_users(ctx, field) if err != nil { return graphql.Null } @@ -7176,7 +7353,7 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) + return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7188,43 +7365,27 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field } return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Group", Field: field, IsMethod: true, - IsResolver: 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) }, } defer func() { @@ -7234,15 +7395,15 @@ func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) +func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -7255,83 +7416,41 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) + return obj.Edges, 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.(*ent.Todo) + res := resTmp.([]*ent.GroupEdge) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + case "node": + return ec.fieldContext_GroupEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) +func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -7344,7 +7463,7 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(string), fc.Args["input"].(ent.UpdateTodoInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -7356,71 +7475,36 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*ent.Todo) + res := resTmp.(entgql.PageInfo[string]) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + 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 Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) +func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -7433,7 +7517,7 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ClearTodos(rctx) + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -7450,12 +7534,12 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, @@ -7463,8 +7547,8 @@ func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, return fc, nil } -func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) +func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -7476,64 +7560,71 @@ func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(string), fc.Args["input"].(UpdateFriendshipInput)) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + } + + directive1 := func(ctx context.Context) (any, error) { + permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) + if err != nil { + var zeroVal *ent.Group + return zeroVal, err + } + if ec.directives.HasPermissions == nil { + var zeroVal *ent.Group + return zeroVal, errors.New("directive hasPermissions is not implemented") + } + return ec.directives.HasPermissions(ctx, obj, directive0, permissions) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*ent.Group); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todogotype/ent.Group`, tmp) }) 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.Friendship) + res := resTmp.(*ent.Group) fc.Result = res - return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) + return ec.fieldContext_Group_id(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_id(ctx, field) +func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7546,7 +7637,7 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7558,26 +7649,26 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entgql.Cursor[string]) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "GroupEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_name(ctx, field) +func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) if err != nil { return graphql.Null } @@ -7590,7 +7681,7 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) }) if err != nil { ec.Error(ctx, err) @@ -7602,67 +7693,61 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_field2(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 + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Field2, nil - }) - if err != nil { + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OneToMany", - 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, err } return fc, nil } -func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_parent(ctx, field) +func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) if err != nil { return graphql.Null } @@ -7675,47 +7760,83 @@ func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent, nil + return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) }) 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.(*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_children(ctx, field) +func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) if err != nil { return graphql.Null } @@ -7728,47 +7849,83 @@ func (ec *executionContext) _OneToMany_children(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children, nil + return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(string), fc.Args["input"].(ent.UpdateTodoInput)) }) 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.([]*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyᚄ(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) +func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) if err != nil { return graphql.Null } @@ -7781,41 +7938,38 @@ func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return ec.resolvers.Mutation().ClearTodos(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*OneToManyEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_OneToManyEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_OneToManyEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) +func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) if err != nil { return graphql.Null } @@ -7828,7 +7982,7 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(string), fc.Args["input"].(UpdateFriendshipInput)) }) if err != nil { ec.Error(ctx, err) @@ -7840,36 +7994,51 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f } return graphql.Null } - res := resTmp.(*entgql.PageInfo[string]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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) + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) +func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_id(ctx, field) if err != nil { return graphql.Null } @@ -7882,7 +8051,7 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7894,26 +8063,26 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "OneToMany", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) +func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_name(ctx, field) if err != nil { return graphql.Null } @@ -7926,47 +8095,38 @@ func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*OneToMany) + res := resTmp.(string) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) +func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_field2(ctx, field) if err != nil { return graphql.Null } @@ -7979,38 +8139,35 @@ func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Field2, 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[string]) + res := resTmp.(*string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_id(ctx, field) +func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_parent(ctx, field) if err != nil { return graphql.Null } @@ -8023,38 +8180,47 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Organization().ID(rctx, obj) + return obj.Parent, 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) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", Field: field, - IsMethod: true, - IsResolver: true, + 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_name(ctx, field) +func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_children(ctx, field) if err != nil { return graphql.Null } @@ -8067,38 +8233,47 @@ func (ec *executionContext) _Organization_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Children, 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) + res := resTmp.([]*OneToMany) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -8111,38 +8286,41 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.Edges, 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) + res := resTmp.([]*OneToManyEdge) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_OneToManyEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OneToManyEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -8155,7 +8333,7 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasPreviousPage, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -8167,26 +8345,36 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*entgql.PageInfo[string]) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + 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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8199,35 +8387,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + 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.(*entgql.Cursor[string]) + res := resTmp.(int) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) +func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8240,7 +8431,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) @@ -8249,26 +8440,38 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*entgql.Cursor[string]) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_id(ctx, field) +func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8281,7 +8484,7 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8293,26 +8496,26 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entgql.Cursor[string]) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "OneToManyEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_todos(ctx, field) +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_id(ctx, field) if err != nil { return graphql.Null } @@ -8325,7 +8528,7 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Todos, nil + return ec.resolvers.Organization().ID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8337,45 +8540,26 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Organization", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } 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) +func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_name(ctx, field) if err != nil { return graphql.Null } @@ -8388,50 +8572,42 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Node(rctx, fc.Args["id"].(string)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(ent.Noder) + res := resTmp.(string) fc.Result = res - return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Organization", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_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) + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (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)) @@ -8440,7 +8616,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]string)) + return obj.HasNextPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8452,37 +8628,26 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]ent.Noder) + res := resTmp.(bool) fc.Result = res - return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_billProducts(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -8495,7 +8660,7 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().BillProducts(rctx) + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8507,36 +8672,26 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*ent.BillProduct) + res := resTmp.(bool) fc.Result = res - return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐBillProductᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_BillProduct_id(ctx, field) - case "name": - return ec.fieldContext_BillProduct_name(ctx, field) - case "sku": - return ec.fieldContext_BillProduct_sku(ctx, field) - case "quantity": - return ec.fieldContext_BillProduct_quantity(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BillProduct", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } 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) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -8549,57 +8704,35 @@ func (ec *executionContext) _Query_categories(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.CategoryOrder), fc.Args["where"].(*ent.CategoryWhereInput)) + return obj.StartCursor, 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.(*ent.CategoryConnection) + res := resTmp.(*entgql.Cursor[string]) fc.Result = res - return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategoryConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, 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) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_categories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_groups(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -8612,57 +8745,35 @@ func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.EndCursor, 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.(*ent.GroupConnection) + res := resTmp.(*entgql.Cursor[string]) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_oneToMany(ctx, field) +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_id(ctx, field) if err != nil { return graphql.Null } @@ -8675,7 +8786,7 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8687,45 +8798,26 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*OneToManyConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyConnection(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_OneToManyConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todos(ctx, field) +func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_todos(ctx, field) if err != nil { return graphql.Null } @@ -8738,7 +8830,7 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.Todos, nil }) if err != nil { ec.Error(ctx, err) @@ -8755,12 +8847,12 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": @@ -8780,15 +8872,15 @@ func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_users(ctx, field) +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 } @@ -8801,39 +8893,28 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } defer func() { @@ -8843,15 +8924,15 @@ func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ping(ctx, field) +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 } @@ -8864,7 +8945,7 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ping(rctx) + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -8876,26 +8957,37 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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("field of type String does not have child fields") + 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_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) +func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_billProducts(ctx, field) if err != nil { return graphql.Null } @@ -8908,7 +9000,7 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return ec.resolvers.Query().BillProducts(rctx) }) if err != nil { ec.Error(ctx, err) @@ -8920,12 +9012,12 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.([]*ent.BillProduct) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐBillProductᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -8933,32 +9025,23 @@ func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_BillProduct_id(ctx, field) + case "name": + return ec.fieldContext_BillProduct_name(ctx, field) + case "sku": + return ec.fieldContext_BillProduct_sku(ctx, field) + case "quantity": + return ec.fieldContext_BillProduct_quantity(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type BillProduct", 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_todosWithJoins_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) +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 } @@ -8971,50 +9054,39 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), 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.(*introspection.Type) + res := resTmp.(*ent.CategoryConnection) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategoryConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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: false, + IsResolver: true, 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) + 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 __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CategoryConnection", field.Name) }, } defer func() { @@ -9024,15 +9096,15 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _Query_directiveExamples(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_directiveExamples(ctx, field) if err != nil { return graphql.Null } @@ -9045,49 +9117,52 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return ec.resolvers.Query().DirectiveExamples(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]*DirectiveExample) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_directiveExamples(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, 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) + case "id": + return ec.fieldContext_DirectiveExample_id(ctx, field) + case "onTypeField": + return ec.fieldContext_DirectiveExample_onTypeField(ctx, field) + case "onMutationFields": + return ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) + case "onMutationCreate": + return ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) + case "onMutationUpdate": + return ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) + case "onAllFields": + return ec.fieldContext_DirectiveExample_onAllFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DirectiveExample", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_id(ctx, field) +func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groups(ctx, field) if err != nil { return graphql.Null } @@ -9100,7 +9175,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9112,26 +9187,45 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_createdAt(ctx, field) +func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oneToMany(ctx, field) if err != nil { return graphql.Null } @@ -9144,7 +9238,7 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9156,26 +9250,45 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*OneToManyConnection) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐOneToManyConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_OneToManyConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", 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_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_status(ctx, field) +func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todos(ctx, field) if err != nil { return graphql.Null } @@ -9188,7 +9301,7 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().Status(rctx, obj) + return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9200,26 +9313,45 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(todo.Status) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TodoStatus does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) +func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_users(ctx, field) if err != nil { return graphql.Null } @@ -9232,7 +9364,7 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Priority, nil + return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9244,26 +9376,45 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err } return fc, nil } -func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_text(ctx, field) +func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ping(ctx, field) if err != nil { return graphql.Null } @@ -9276,7 +9427,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Text, nil + return ec.resolvers.Query().Ping(rctx) }) if err != nil { ec.Error(ctx, err) @@ -9293,12 +9444,12 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -9306,8 +9457,8 @@ func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryID(ctx, field) +func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) if err != nil { return graphql.Null } @@ -9320,35 +9471,57 @@ func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) 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.(bigintgql.BigInt) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todosWithJoins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category_id(ctx, field) +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 } @@ -9361,7 +9534,7 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -9370,26 +9543,59 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(bigintgql.BigInt) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + 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) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryX(ctx, field) +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 } @@ -9402,7 +9608,7 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) @@ -9411,26 +9617,40 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(bigintgql.BigInt) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_init(ctx, field) +func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_id(ctx, field) if err != nil { return graphql.Null } @@ -9443,35 +9663,38 @@ func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Init, nil + 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.(map[string]interface{}) + res := resTmp.(string) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_custom(ctx, field) +func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -9484,39 +9707,38 @@ func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Custom, nil + 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.([]customstruct.Custom) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_customp(ctx, field) +func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_status(ctx, field) if err != nil { return graphql.Null } @@ -9529,39 +9751,38 @@ func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Customp, nil + return ec.resolvers.Todo().Status(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*customstruct.Custom) + res := resTmp.(todo.Status) fc.Result = res - return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) + return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type TodoStatus does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_value(ctx, field) +func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) if err != nil { return graphql.Null } @@ -9574,7 +9795,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Value, nil + return obj.Priority, nil }) if err != nil { ec.Error(ctx, err) @@ -9591,7 +9812,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, @@ -9604,8 +9825,8 @@ func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field gra return fc, nil } -func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_parent(ctx, field) +func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_text(ctx, field) if err != nil { return graphql.Null } @@ -9618,69 +9839,38 @@ func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent(ctx) + return obj.Text, 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.(*ent.Todo) + res := resTmp.(string) fc.Result = res - return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_children(ctx, field) +func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryID(ctx, field) if err != nil { return graphql.Null } @@ -9693,57 +9883,76 @@ func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.CategoryID, 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.(*ent.TodoConnection) + res := resTmp.(bigintgql.BigInt) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CategoryID, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bigintgql.BigInt) + fc.Result = res + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Todo", + 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) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category(ctx, field) +func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryX(ctx, field) if err != nil { return graphql.Null } @@ -9756,7 +9965,7 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Category(ctx) + return obj.CategoryID, nil }) if err != nil { ec.Error(ctx, err) @@ -9765,50 +9974,26 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(bigintgql.BigInt) fc.Result = res - return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚋschemaᚋbigintgqlᚐBigInt(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_extendedField(ctx, field) +func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_init(ctx, field) if err != nil { return graphql.Null } @@ -9821,7 +10006,7 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().ExtendedField(rctx, obj) + return obj.Init, nil }) if err != nil { ec.Error(ctx, err) @@ -9830,26 +10015,26 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) +func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_custom(ctx, field) if err != nil { return graphql.Null } @@ -9862,7 +10047,7 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Custom, nil }) if err != nil { ec.Error(ctx, err) @@ -9871,32 +10056,30 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.TodoEdge) + res := resTmp.([]customstruct.Custom) fc.Result = res - return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoEdge(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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_TodoEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_TodoEdge_cursor(ctx, field) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) +func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_customp(ctx, field) if err != nil { return graphql.Null } @@ -9909,48 +10092,39 @@ func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Customp, 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[string]) + res := resTmp.([]*customstruct.Custom) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) +func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_value(ctx, field) if err != nil { return graphql.Null } @@ -9963,7 +10137,7 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -9980,9 +10154,9 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", Field: field, IsMethod: false, IsResolver: false, @@ -9993,8 +10167,8 @@ func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Con return fc, nil } -func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_node(ctx, field) +func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_parent(ctx, field) if err != nil { return graphql.Null } @@ -10007,7 +10181,7 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Parent(ctx) }) if err != nil { ec.Error(ctx, err) @@ -10021,11 +10195,11 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -10068,8 +10242,8 @@ func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field return fc, nil } -func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) +func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_children(ctx, field) if err != nil { return graphql.Null } @@ -10082,7 +10256,7 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10094,26 +10268,45 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[string]) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_id(ctx, field) + 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_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category(ctx, field) if err != nil { return graphql.Null } @@ -10126,38 +10319,59 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Category(ctx) }) 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) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_name(ctx, field) +func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_extendedField(ctx, field) if err != nil { return graphql.Null } @@ -10170,29 +10384,26 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Todo().ExtendedField(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -10200,8 +10411,8 @@ func (ec *executionContext) fieldContext_User_name(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_username(ctx, field) +func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10214,38 +10425,41 @@ func (ec *executionContext) _User_username(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Username(rctx, obj) + return obj.Edges, 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) + res := resTmp.([]*ent.TodoEdge) fc.Result = res - return ec.marshalNUUID2string(ctx, field.Selections, res) + return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodoEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_TodoEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TodoEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) +func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10258,7 +10472,7 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().RequiredMetadata(rctx, obj) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10270,26 +10484,36 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(map[string]any) + res := resTmp.(entgql.PageInfo[string]) fc.Result = res - return ec.marshalNMap2map(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + 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) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_metadata(ctx, field) +func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10302,35 +10526,38 @@ func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Metadata(rctx, obj) + 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.(map[string]any) + res := resTmp.(int) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_groups(ctx, field) +func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -10343,57 +10570,69 @@ func (ec *executionContext) _User_groups(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.Node, 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.(*ent.GroupConnection) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friends(ctx, field) +func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -10406,7 +10645,7 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friends(rctx, obj, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -10418,45 +10657,26 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.Cursor[string]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friendships(ctx, field) +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) if err != nil { return graphql.Null } @@ -10469,7 +10689,7 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -10481,45 +10701,26 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*ent.FriendshipConnection) + res := resTmp.(string) fc.Result = res - return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendshipConnection(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "User", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_FriendshipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_edges(ctx, field) +func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_name(ctx, field) if err != nil { return graphql.Null } @@ -10532,41 +10733,38 @@ func (ec *executionContext) _UserConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*ent.UserEdge) + res := resTmp.(string) fc.Result = res - return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserEdge(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", 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_UserEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_UserEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) +func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_username(ctx, field) if err != nil { return graphql.Null } @@ -10579,7 +10777,7 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.User().Username(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -10591,36 +10789,26 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.PageInfo[string]) + res := resTmp.(string) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNUUID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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 nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) +func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) if err != nil { return graphql.Null } @@ -10633,7 +10821,7 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return ec.resolvers.User().RequiredMetadata(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -10645,26 +10833,26 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(int) + res := resTmp.(map[string]any) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_node(ctx, field) +func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(ctx, field) if err != nil { return graphql.Null } @@ -10677,7 +10865,7 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return ec.resolvers.User().Metadata(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -10686,44 +10874,26 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.User) + res := resTmp.(map[string]any) fc.Result = res - return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) +func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groups(ctx, field) if err != nil { return graphql.Null } @@ -10736,7 +10906,7 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10748,26 +10918,45 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[string]) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friends(ctx, field) if err != nil { return graphql.Null } @@ -10780,7 +10969,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.User().Friends(rctx, obj, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10792,26 +10981,45 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friendships(ctx, field) if err != nil { return graphql.Null } @@ -10824,35 +11032,57 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) }) 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) + res := resTmp.(*ent.FriendshipConnection) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐFriendshipConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_FriendshipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", 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_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10865,38 +11095,41 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Edges, 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) + res := resTmp.([]*ent.UserEdge) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUserEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_UserEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10909,7 +11142,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10921,36 +11154,36 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(entgql.PageInfo[string]) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "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 __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10963,7 +11196,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -10975,26 +11208,26 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -11007,38 +11240,53 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Node, 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) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -11051,35 +11299,38 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + 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.(*string) + res := resTmp.(entgql.Cursor[string]) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -11092,7 +11343,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11104,26 +11355,26 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -11136,7 +11387,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11150,9 +11401,9 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, IsMethod: true, IsResolver: false, @@ -11163,8 +11414,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -11177,7 +11428,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) @@ -11189,67 +11440,26 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -11279,9 +11489,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, @@ -11302,8 +11512,8 @@ func (ec *executionContext) fieldContext___Field_args(_ context.Context, field g return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -11316,7 +11526,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -11328,48 +11538,26 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11382,7 +11570,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11394,26 +11582,26 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11426,7 +11614,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11440,9 +11628,9 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11453,8 +11641,8 @@ func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Con return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11467,7 +11655,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -11479,26 +11667,26 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__EnumValue", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11511,7 +11699,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -11525,9 +11713,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11538,8 +11726,8 @@ func (ec *executionContext) fieldContext___InputValue_description(_ context.Cont return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -11552,7 +11740,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11564,48 +11752,26 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -11618,7 +11784,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11632,11 +11798,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -11645,8 +11811,8 @@ func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Con return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) if err != nil { return graphql.Null } @@ -11659,35 +11825,48 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, - IsMethod: true, + 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -11700,7 +11879,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -11712,16 +11891,16 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -11752,8 +11931,8 @@ func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11766,7 +11945,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) @@ -11778,48 +11957,26 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", 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) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11832,7 +11989,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -11841,48 +11998,26 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", 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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11895,57 +12030,38 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11958,50 +12074,35 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -12014,7 +12115,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -12026,26 +12127,48 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -12058,7 +12181,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -12072,11 +12195,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__InputValue", Field: field, - IsMethod: true, + 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") @@ -12085,8 +12208,8 @@ func (ec *executionContext) fieldContext___Type_name(_ context.Context, field gr return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) if err != nil { return graphql.Null } @@ -12113,9 +12236,9 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -12126,8 +12249,8 @@ func (ec *executionContext) fieldContext___Type_description(_ context.Context, f return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) if err != nil { return graphql.Null } @@ -12140,60 +12263,60 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.Types(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Field_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) + return 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 __Field", field.Name) + 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___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) if err != nil { return graphql.Null } @@ -12206,23 +12329,26 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.QueryType(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -12255,8 +12381,8 @@ func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) if err != nil { return graphql.Null } @@ -12269,7 +12395,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.MutationType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12278,14 +12404,14 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, @@ -12318,8 +12444,8 @@ func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } @@ -12332,7 +12458,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.SubscriptionType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12341,47 +12467,148 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___EnumValue_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + 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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) if err != nil { return graphql.Null } @@ -12394,7 +12621,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Name(), nil }) if err != nil { ec.Error(ctx, err) @@ -12403,12 +12630,94 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12417,22 +12726,37 @@ func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, f Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": - return ec.fieldContext___InputValue_name(ctx, field) + return ec.fieldContext___Field_name(ctx, field) case "description": - return ec.fieldContext___InputValue_description(ctx, field) + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) if err != nil { return graphql.Null } @@ -12445,7 +12769,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Interfaces(), nil }) if err != nil { ec.Error(ctx, err) @@ -12454,12 +12778,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12494,8 +12818,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) if err != nil { return graphql.Null } @@ -12508,7 +12832,246 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil }) if err != nil { ec.Error(ctx, err) @@ -13514,36 +14077,142 @@ func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Contex return it, nil } -func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { - var it ent.CreateTodoInput +func (ec *executionContext) unmarshalInputCreateDirectiveExampleInput(ctx context.Context, obj any) (CreateDirectiveExampleInput, error) { + var it CreateDirectiveExampleInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} + fieldsInOrder := [...]string{"onTypeField", "onMutationFields", "onMutationCreate", "onMutationUpdate", "onAllFields"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { - return it, err + it.OnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) } - case "priority": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + + tmp, err := directive1(ctx) if err != nil { - return it, err + return it, graphql.ErrorOnPath(ctx, err) } - it.Priority = data + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationCreate = data + } else if tmp == nil { + it.OnMutationCreate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdate = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { + var it ent.CreateTodoInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { + return it, err + } + case "priority": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Priority = data case "text": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) data, err := ec.unmarshalNString2string(ctx, v) @@ -13619,49 +14288,671 @@ func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, o if err != nil { return it, err } - it.Name = data - case "username": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) - data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + it.Name = data + case "username": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Username = data + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Password = data + case "requiredMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) + data, err := ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + it.RequiredMetadata = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "friendIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FriendIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDirectiveExampleWhereInput(ctx context.Context, obj any) (DirectiveExampleWhereInput, error) { + var it DirectiveExampleWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "onTypeField", "onTypeFieldNEQ", "onTypeFieldIn", "onTypeFieldNotIn", "onTypeFieldGT", "onTypeFieldGTE", "onTypeFieldLT", "onTypeFieldLTE", "onTypeFieldContains", "onTypeFieldHasPrefix", "onTypeFieldHasSuffix", "onTypeFieldIsNil", "onTypeFieldNotNil", "onTypeFieldEqualFold", "onTypeFieldContainsFold", "onMutationFields", "onMutationFieldsNEQ", "onMutationFieldsIn", "onMutationFieldsNotIn", "onMutationFieldsGT", "onMutationFieldsGTE", "onMutationFieldsLT", "onMutationFieldsLTE", "onMutationFieldsContains", "onMutationFieldsHasPrefix", "onMutationFieldsHasSuffix", "onMutationFieldsIsNil", "onMutationFieldsNotNil", "onMutationFieldsEqualFold", "onMutationFieldsContainsFold", "onMutationCreate", "onMutationCreateNEQ", "onMutationCreateIn", "onMutationCreateNotIn", "onMutationCreateGT", "onMutationCreateGTE", "onMutationCreateLT", "onMutationCreateLTE", "onMutationCreateContains", "onMutationCreateHasPrefix", "onMutationCreateHasSuffix", "onMutationCreateIsNil", "onMutationCreateNotNil", "onMutationCreateEqualFold", "onMutationCreateContainsFold", "onMutationUpdate", "onMutationUpdateNEQ", "onMutationUpdateIn", "onMutationUpdateNotIn", "onMutationUpdateGT", "onMutationUpdateGTE", "onMutationUpdateLT", "onMutationUpdateLTE", "onMutationUpdateContains", "onMutationUpdateHasPrefix", "onMutationUpdateHasSuffix", "onMutationUpdateIsNil", "onMutationUpdateNotNil", "onMutationUpdateEqualFold", "onMutationUpdateContainsFold", "onAllFields", "onAllFieldsNEQ", "onAllFieldsIn", "onAllFieldsNotIn", "onAllFieldsGT", "onAllFieldsGTE", "onAllFieldsLT", "onAllFieldsLTE", "onAllFieldsContains", "onAllFieldsHasPrefix", "onAllFieldsHasSuffix", "onAllFieldsIsNil", "onAllFieldsNotNil", "onAllFieldsEqualFold", "onAllFieldsContainsFold"} + 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.unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDNeq = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDGt = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDGte = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLt = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLte = data + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeField = data + case "onTypeFieldNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldNeq = data + case "onTypeFieldIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldIn = data + case "onTypeFieldNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldNotIn = data + case "onTypeFieldGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldGt = data + case "onTypeFieldGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldGte = data + case "onTypeFieldLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldLt = data + case "onTypeFieldLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldLte = data + case "onTypeFieldContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldContains = data + case "onTypeFieldHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldHasPrefix = data + case "onTypeFieldHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldHasSuffix = data + case "onTypeFieldIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldIsNil = data + case "onTypeFieldNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldNotNil = data + case "onTypeFieldEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldEqualFold = data + case "onTypeFieldContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeFieldContainsFold = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFields = data + case "onMutationFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsNeq = data + case "onMutationFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsIn = data + case "onMutationFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsNotIn = data + case "onMutationFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsGt = data + case "onMutationFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsGte = data + case "onMutationFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsLt = data + case "onMutationFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsLte = data + case "onMutationFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsContains = data + case "onMutationFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsHasPrefix = data + case "onMutationFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsHasSuffix = data + case "onMutationFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsIsNil = data + case "onMutationFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsNotNil = data + case "onMutationFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsEqualFold = data + case "onMutationFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationFieldsContainsFold = data + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreate = data + case "onMutationCreateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateNeq = data + case "onMutationCreateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateIn = data + case "onMutationCreateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateNotIn = data + case "onMutationCreateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateGt = data + case "onMutationCreateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateGte = data + case "onMutationCreateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateLt = data + case "onMutationCreateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateLte = data + case "onMutationCreateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateContains = data + case "onMutationCreateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateHasPrefix = data + case "onMutationCreateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateHasSuffix = data + case "onMutationCreateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateIsNil = data + case "onMutationCreateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateNotNil = data + case "onMutationCreateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateEqualFold = data + case "onMutationCreateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreateContainsFold = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdate = data + case "onMutationUpdateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateNeq = data + case "onMutationUpdateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateIn = data + case "onMutationUpdateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateNotIn = data + case "onMutationUpdateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateGt = data + case "onMutationUpdateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateGte = data + case "onMutationUpdateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateLt = data + case "onMutationUpdateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateLte = data + case "onMutationUpdateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateContains = data + case "onMutationUpdateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateHasPrefix = data + case "onMutationUpdateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateHasSuffix = data + case "onMutationUpdateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateIsNil = data + case "onMutationUpdateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateNotNil = data + case "onMutationUpdateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateEqualFold = data + case "onMutationUpdateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdateContainsFold = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFields = data + case "onAllFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsNeq = data + case "onAllFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsIn = data + case "onAllFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsNotIn = data + case "onAllFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsGt = data + case "onAllFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsGte = data + case "onAllFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Username = data - case "password": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + it.OnAllFieldsLt = data + case "onAllFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Password = data - case "requiredMetadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) - data, err := ec.unmarshalNMap2map(ctx, v) + it.OnAllFieldsLte = data + case "onAllFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.RequiredMetadata = data - case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnAllFieldsContains = data + case "onAllFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Metadata = data - case "groupIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) - data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + it.OnAllFieldsHasPrefix = data + case "onAllFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.GroupIDs = data - case "friendIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) - data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + it.OnAllFieldsHasSuffix = data + case "onAllFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.FriendIDs = data + it.OnAllFieldsIsNil = data + case "onAllFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsNotNil = data + case "onAllFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsEqualFold = data + case "onAllFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsContainsFold = data } } @@ -15359,6 +16650,198 @@ func (ec *executionContext) unmarshalInputUpdateCategoryInput(ctx context.Contex return it, nil } +func (ec *executionContext) unmarshalInputUpdateDirectiveExampleInput(ctx context.Context, obj any) (UpdateDirectiveExampleInput, error) { + var it UpdateDirectiveExampleInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"onTypeField", "clearOnTypeField", "onMutationFields", "clearOnMutationFields", "onMutationCreate", "clearOnMutationCreate", "onMutationUpdate", "clearOnMutationUpdate", "onAllFields", "clearOnAllFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeField = data + case "clearOnTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnTypeField")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationFields = data + } else if tmp == nil { + it.ClearOnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreate = data + case "clearOnMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationCreate")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnMutationCreate = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationUpdate = data + } else if tmp == nil { + it.OnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationUpdate = data + } else if tmp == nil { + it.ClearOnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnAllFields = data + } else if tmp == nil { + it.ClearOnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputUpdateFriendshipInput(ctx context.Context, obj any) (UpdateFriendshipInput, error) { var it UpdateFriendshipInput asMap := map[string]any{} @@ -16001,6 +17484,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Category(ctx, sel, obj) + case DirectiveExample: + return ec._DirectiveExample(ctx, sel, &obj) + case *DirectiveExample: + if obj == nil { + return graphql.Null + } + return ec._DirectiveExample(ctx, sel, obj) case *ent.Friendship: if obj == nil { return graphql.Null @@ -16491,6 +17981,55 @@ func (ec *executionContext) _Custom(ctx context.Context, sel ast.SelectionSet, o return out } +var directiveExampleImplementors = []string{"DirectiveExample", "Node"} + +func (ec *executionContext) _DirectiveExample(ctx context.Context, sel ast.SelectionSet, obj *DirectiveExample) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, directiveExampleImplementors) + + 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("DirectiveExample") + case "id": + out.Values[i] = ec._DirectiveExample_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "onTypeField": + out.Values[i] = ec._DirectiveExample_onTypeField(ctx, field, obj) + case "onMutationFields": + out.Values[i] = ec._DirectiveExample_onMutationFields(ctx, field, obj) + case "onMutationCreate": + out.Values[i] = ec._DirectiveExample_onMutationCreate(ctx, field, obj) + case "onMutationUpdate": + out.Values[i] = ec._DirectiveExample_onMutationUpdate(ctx, field, obj) + case "onAllFields": + out.Values[i] = ec._DirectiveExample_onAllFields(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 friendshipImplementors = []string{"Friendship", "Node"} func (ec *executionContext) _Friendship(ctx context.Context, sel ast.SelectionSet, obj *ent.Friendship) graphql.Marshaler { @@ -17355,6 +18894,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "directiveExamples": + 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_directiveExamples(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 "groups": field := field @@ -18690,6 +20251,65 @@ func (ec *executionContext) marshalNCustom2entgoᚗioᚋcontribᚋentgqlᚋinter return ec._Custom(ctx, sel, &v) } +func (ec *executionContext) marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleᚄ(ctx context.Context, sel ast.SelectionSet, v []*DirectiveExample) 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.marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExample(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExample(ctx context.Context, sel ast.SelectionSet, v *DirectiveExample) 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._DirectiveExample(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNDuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) @@ -19846,6 +21466,34 @@ func (ec *executionContext) marshalOCustom2ᚖentgoᚗioᚋcontribᚋentgqlᚋin return ec._Custom(ctx, sel, v) } +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInputᚄ(ctx context.Context, v any) ([]*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []any + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*DirectiveExampleWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodogotypeᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalODuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/entgql/internal/todogotype/models_gen.go b/entgql/internal/todogotype/models_gen.go index be74852ee..62ee7b3cd 100644 --- a/entgql/internal/todogotype/models_gen.go +++ b/entgql/internal/todogotype/models_gen.go @@ -24,6 +24,16 @@ type CategoryTypesInput struct { Public *bool `json:"public,omitempty"` } +// CreateDirectiveExampleInput is used for create DirectiveExample object. +// Input was generated by ent. +type CreateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + // CreateUserInput is used for create User object. // Input was generated by ent. type CreateUserInput struct { @@ -36,6 +46,114 @@ type CreateUserInput struct { FriendIDs []string `json:"friendIDs,omitempty"` } +type DirectiveExample struct { + ID string `json:"id"` + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + +func (DirectiveExample) IsNode() {} + +// DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +// Input was generated by ent. +type DirectiveExampleWhereInput struct { + Not *DirectiveExampleWhereInput `json:"not,omitempty"` + And []*DirectiveExampleWhereInput `json:"and,omitempty"` + Or []*DirectiveExampleWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + // on_type_field field predicates + OnTypeField *string `json:"onTypeField,omitempty"` + OnTypeFieldNeq *string `json:"onTypeFieldNEQ,omitempty"` + OnTypeFieldIn []string `json:"onTypeFieldIn,omitempty"` + OnTypeFieldNotIn []string `json:"onTypeFieldNotIn,omitempty"` + OnTypeFieldGt *string `json:"onTypeFieldGT,omitempty"` + OnTypeFieldGte *string `json:"onTypeFieldGTE,omitempty"` + OnTypeFieldLt *string `json:"onTypeFieldLT,omitempty"` + OnTypeFieldLte *string `json:"onTypeFieldLTE,omitempty"` + OnTypeFieldContains *string `json:"onTypeFieldContains,omitempty"` + OnTypeFieldHasPrefix *string `json:"onTypeFieldHasPrefix,omitempty"` + OnTypeFieldHasSuffix *string `json:"onTypeFieldHasSuffix,omitempty"` + OnTypeFieldIsNil *bool `json:"onTypeFieldIsNil,omitempty"` + OnTypeFieldNotNil *bool `json:"onTypeFieldNotNil,omitempty"` + OnTypeFieldEqualFold *string `json:"onTypeFieldEqualFold,omitempty"` + OnTypeFieldContainsFold *string `json:"onTypeFieldContainsFold,omitempty"` + // on_mutation_fields field predicates + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationFieldsNeq *string `json:"onMutationFieldsNEQ,omitempty"` + OnMutationFieldsIn []string `json:"onMutationFieldsIn,omitempty"` + OnMutationFieldsNotIn []string `json:"onMutationFieldsNotIn,omitempty"` + OnMutationFieldsGt *string `json:"onMutationFieldsGT,omitempty"` + OnMutationFieldsGte *string `json:"onMutationFieldsGTE,omitempty"` + OnMutationFieldsLt *string `json:"onMutationFieldsLT,omitempty"` + OnMutationFieldsLte *string `json:"onMutationFieldsLTE,omitempty"` + OnMutationFieldsContains *string `json:"onMutationFieldsContains,omitempty"` + OnMutationFieldsHasPrefix *string `json:"onMutationFieldsHasPrefix,omitempty"` + OnMutationFieldsHasSuffix *string `json:"onMutationFieldsHasSuffix,omitempty"` + OnMutationFieldsIsNil *bool `json:"onMutationFieldsIsNil,omitempty"` + OnMutationFieldsNotNil *bool `json:"onMutationFieldsNotNil,omitempty"` + OnMutationFieldsEqualFold *string `json:"onMutationFieldsEqualFold,omitempty"` + OnMutationFieldsContainsFold *string `json:"onMutationFieldsContainsFold,omitempty"` + // on_mutation_create field predicates + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationCreateNeq *string `json:"onMutationCreateNEQ,omitempty"` + OnMutationCreateIn []string `json:"onMutationCreateIn,omitempty"` + OnMutationCreateNotIn []string `json:"onMutationCreateNotIn,omitempty"` + OnMutationCreateGt *string `json:"onMutationCreateGT,omitempty"` + OnMutationCreateGte *string `json:"onMutationCreateGTE,omitempty"` + OnMutationCreateLt *string `json:"onMutationCreateLT,omitempty"` + OnMutationCreateLte *string `json:"onMutationCreateLTE,omitempty"` + OnMutationCreateContains *string `json:"onMutationCreateContains,omitempty"` + OnMutationCreateHasPrefix *string `json:"onMutationCreateHasPrefix,omitempty"` + OnMutationCreateHasSuffix *string `json:"onMutationCreateHasSuffix,omitempty"` + OnMutationCreateIsNil *bool `json:"onMutationCreateIsNil,omitempty"` + OnMutationCreateNotNil *bool `json:"onMutationCreateNotNil,omitempty"` + OnMutationCreateEqualFold *string `json:"onMutationCreateEqualFold,omitempty"` + OnMutationCreateContainsFold *string `json:"onMutationCreateContainsFold,omitempty"` + // on_mutation_update field predicates + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnMutationUpdateNeq *string `json:"onMutationUpdateNEQ,omitempty"` + OnMutationUpdateIn []string `json:"onMutationUpdateIn,omitempty"` + OnMutationUpdateNotIn []string `json:"onMutationUpdateNotIn,omitempty"` + OnMutationUpdateGt *string `json:"onMutationUpdateGT,omitempty"` + OnMutationUpdateGte *string `json:"onMutationUpdateGTE,omitempty"` + OnMutationUpdateLt *string `json:"onMutationUpdateLT,omitempty"` + OnMutationUpdateLte *string `json:"onMutationUpdateLTE,omitempty"` + OnMutationUpdateContains *string `json:"onMutationUpdateContains,omitempty"` + OnMutationUpdateHasPrefix *string `json:"onMutationUpdateHasPrefix,omitempty"` + OnMutationUpdateHasSuffix *string `json:"onMutationUpdateHasSuffix,omitempty"` + OnMutationUpdateIsNil *bool `json:"onMutationUpdateIsNil,omitempty"` + OnMutationUpdateNotNil *bool `json:"onMutationUpdateNotNil,omitempty"` + OnMutationUpdateEqualFold *string `json:"onMutationUpdateEqualFold,omitempty"` + OnMutationUpdateContainsFold *string `json:"onMutationUpdateContainsFold,omitempty"` + // on_all_fields field predicates + OnAllFields *string `json:"onAllFields,omitempty"` + OnAllFieldsNeq *string `json:"onAllFieldsNEQ,omitempty"` + OnAllFieldsIn []string `json:"onAllFieldsIn,omitempty"` + OnAllFieldsNotIn []string `json:"onAllFieldsNotIn,omitempty"` + OnAllFieldsGt *string `json:"onAllFieldsGT,omitempty"` + OnAllFieldsGte *string `json:"onAllFieldsGTE,omitempty"` + OnAllFieldsLt *string `json:"onAllFieldsLT,omitempty"` + OnAllFieldsLte *string `json:"onAllFieldsLTE,omitempty"` + OnAllFieldsContains *string `json:"onAllFieldsContains,omitempty"` + OnAllFieldsHasPrefix *string `json:"onAllFieldsHasPrefix,omitempty"` + OnAllFieldsHasSuffix *string `json:"onAllFieldsHasSuffix,omitempty"` + OnAllFieldsIsNil *bool `json:"onAllFieldsIsNil,omitempty"` + OnAllFieldsNotNil *bool `json:"onAllFieldsNotNil,omitempty"` + OnAllFieldsEqualFold *string `json:"onAllFieldsEqualFold,omitempty"` + OnAllFieldsContainsFold *string `json:"onAllFieldsContainsFold,omitempty"` +} + type OneToMany struct { ID string `json:"id"` Name string `json:"name"` @@ -183,6 +301,21 @@ type ProjectWhereInput struct { HasTodosWith []*ent.TodoWhereInput `json:"hasTodosWith,omitempty"` } +// UpdateDirectiveExampleInput is used for update DirectiveExample object. +// Input was generated by ent. +type UpdateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + ClearOnTypeField *bool `json:"clearOnTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + ClearOnMutationFields *bool `json:"clearOnMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + ClearOnMutationCreate *bool `json:"clearOnMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + ClearOnMutationUpdate *bool `json:"clearOnMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` + ClearOnAllFields *bool `json:"clearOnAllFields,omitempty"` +} + // UpdateFriendshipInput is used for update Friendship object. // Input was generated by ent. type UpdateFriendshipInput struct { diff --git a/entgql/internal/todopulid/ent.resolvers.go b/entgql/internal/todopulid/ent.resolvers.go index 1431852de..0004dc9a2 100644 --- a/entgql/internal/todopulid/ent.resolvers.go +++ b/entgql/internal/todopulid/ent.resolvers.go @@ -59,6 +59,11 @@ func (r *queryResolver) Categories(ctx context.Context, after *entgql.Cursor[pul panic(fmt.Errorf("not implemented")) } +// DirectiveExamples is the resolver for the directiveExamples field. +func (r *queryResolver) DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) { + panic(fmt.Errorf("not implemented: DirectiveExamples - directiveExamples")) +} + // Groups is the resolver for the groups field. func (r *queryResolver) Groups(ctx context.Context, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) { return r.client.Group.Query(). diff --git a/entgql/internal/todopulid/generated.go b/entgql/internal/todopulid/generated.go index b11bab937..ca4b822f0 100644 --- a/entgql/internal/todopulid/generated.go +++ b/entgql/internal/todopulid/generated.go @@ -64,6 +64,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { + FieldDirective func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) HasPermissions func(ctx context.Context, obj any, next graphql.Resolver, permissions []string) (res any, err error) } @@ -112,6 +113,15 @@ type ComplexityRoot struct { Info func(childComplexity int) int } + DirectiveExample struct { + ID func(childComplexity int) int + OnAllFields func(childComplexity int) int + OnMutationCreate func(childComplexity int) int + OnMutationFields func(childComplexity int) int + OnMutationUpdate func(childComplexity int) int + OnTypeField func(childComplexity int) int + } + Friendship struct { CreatedAt func(childComplexity int) int Friend func(childComplexity int) int @@ -194,16 +204,17 @@ type ComplexityRoot struct { } Query struct { - BillProducts func(childComplexity int) int - Categories func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int - Groups func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, where *ent.GroupWhereInput) int - Node func(childComplexity int, id pulid.ID) int - Nodes func(childComplexity int, ids []pulid.ID) int - OneToMany func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int - Ping func(childComplexity int) int - Todos func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - TodosWithJoins func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - Users func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int + BillProducts func(childComplexity int) int + Categories func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int + DirectiveExamples func(childComplexity int) int + Groups func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, where *ent.GroupWhereInput) int + Node func(childComplexity int, id pulid.ID) int + Nodes func(childComplexity int, ids []pulid.ID) int + OneToMany func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int + Ping func(childComplexity int) int + Todos func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + TodosWithJoins func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + Users func(childComplexity int, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int } Todo struct { @@ -277,6 +288,7 @@ type QueryResolver interface { Nodes(ctx context.Context, ids []pulid.ID) ([]ent.Noder, error) BillProducts(ctx context.Context) ([]*ent.BillProduct, error) Categories(ctx context.Context, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) (*ent.CategoryConnection, error) + DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) Groups(ctx context.Context, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) OneToMany(ctx context.Context, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) (*OneToManyConnection, error) Todos(ctx context.Context, after *entgql.Cursor[pulid.ID], first *int, before *entgql.Cursor[pulid.ID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) (*ent.TodoConnection, error) @@ -525,6 +537,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Custom.Info(childComplexity), true + case "DirectiveExample.id": + if e.complexity.DirectiveExample.ID == nil { + break + } + + return e.complexity.DirectiveExample.ID(childComplexity), true + + case "DirectiveExample.onAllFields": + if e.complexity.DirectiveExample.OnAllFields == nil { + break + } + + return e.complexity.DirectiveExample.OnAllFields(childComplexity), true + + case "DirectiveExample.onMutationCreate": + if e.complexity.DirectiveExample.OnMutationCreate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationCreate(childComplexity), true + + case "DirectiveExample.onMutationFields": + if e.complexity.DirectiveExample.OnMutationFields == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationFields(childComplexity), true + + case "DirectiveExample.onMutationUpdate": + if e.complexity.DirectiveExample.OnMutationUpdate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationUpdate(childComplexity), true + + case "DirectiveExample.onTypeField": + if e.complexity.DirectiveExample.OnTypeField == nil { + break + } + + return e.complexity.DirectiveExample.OnTypeField(childComplexity), true + case "Friendship.createdAt": if e.complexity.Friendship.CreatedAt == nil { break @@ -868,6 +922,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Categories(childComplexity, args["after"].(*entgql.Cursor[pulid.ID]), args["first"].(*int), args["before"].(*entgql.Cursor[pulid.ID]), args["last"].(*int), args["orderBy"].([]*ent.CategoryOrder), args["where"].(*ent.CategoryWhereInput)), true + case "Query.directiveExamples": + if e.complexity.Query.DirectiveExamples == nil { + break + } + + return e.complexity.Query.DirectiveExamples(childComplexity), true + case "Query.groups": if e.complexity.Query.Groups == nil { break @@ -1217,8 +1278,10 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCategoryTypesInput, ec.unmarshalInputCategoryWhereInput, ec.unmarshalInputCreateCategoryInput, + ec.unmarshalInputCreateDirectiveExampleInput, ec.unmarshalInputCreateTodoInput, ec.unmarshalInputCreateUserInput, + ec.unmarshalInputDirectiveExampleWhereInput, ec.unmarshalInputFriendshipWhereInput, ec.unmarshalInputGroupWhereInput, ec.unmarshalInputOneToManyOrder, @@ -1228,6 +1291,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputTodoOrder, ec.unmarshalInputTodoWhereInput, ec.unmarshalInputUpdateCategoryInput, + ec.unmarshalInputUpdateDirectiveExampleInput, ec.unmarshalInputUpdateFriendshipInput, ec.unmarshalInputUpdateTodoInput, ec.unmarshalInputUpdateUserInput, @@ -1331,6 +1395,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "../todo/todo.graphql", Input: `directive @hasPermissions(permissions: [String!]!) on OBJECT | FIELD_DEFINITION +directive @fieldDirective on FIELD_DEFINITION | INPUT_FIELD_DEFINITION type CategoryConfig { maxMembers: Int @@ -1412,7 +1477,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! -}`, BuiltIn: false}, +} +`, BuiltIn: false}, {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { @@ -1725,6 +1791,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -1757,6 +1834,124 @@ Define a Relay Cursor type: https://relay.dev/graphql/connections.htm#sec-Cursor """ scalar Cursor +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -2251,6 +2446,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -2618,6 +2814,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ @@ -6208,8 +6420,8 @@ func (ec *executionContext) fieldContext_Custom_info(_ context.Context, field gr return fc, nil } -func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_id(ctx, field) +func (ec *executionContext) _DirectiveExample_id(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_id(ctx, field) if err != nil { return graphql.Null } @@ -6239,9 +6451,9 @@ func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.Co return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, IsMethod: false, IsResolver: false, @@ -6252,8 +6464,8 @@ func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field return fc, nil } -func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) +func (ec *executionContext) _DirectiveExample_onTypeField(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onTypeField(ctx, field) if err != nil { return graphql.Null } @@ -6265,39 +6477,58 @@ func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnTypeField, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onTypeField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_userID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) if err != nil { return graphql.Null } @@ -6310,38 +6541,35 @@ func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.UserID, nil + return obj.OnMutationFields, 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.(pulid.ID) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friendID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationCreate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) if err != nil { return graphql.Null } @@ -6354,38 +6582,35 @@ func (ec *executionContext) _Friendship_friendID(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FriendID, nil + return obj.OnMutationCreate, 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.(pulid.ID) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationCreate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_user(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationUpdate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) if err != nil { return graphql.Null } @@ -6398,56 +6623,35 @@ func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.User(ctx) + return obj.OnMutationUpdate, 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.(*ent.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationUpdate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friend(ctx, field) +func (ec *executionContext) _DirectiveExample_onAllFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onAllFields(ctx, field) if err != nil { return graphql.Null } @@ -6459,57 +6663,58 @@ func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Friend(ctx) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnAllFields, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onAllFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) +func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_id(ctx, field) if err != nil { return graphql.Null } @@ -6522,41 +6727,38 @@ func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.FriendshipEdge) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendshipEdge(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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_FriendshipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_FriendshipEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) +func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -6569,7 +6771,7 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -6581,36 +6783,26 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.PageInfo[pulid.ID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) +func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_userID(ctx, field) if err != nil { return graphql.Null } @@ -6623,7 +6815,7 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.UserID, nil }) if err != nil { ec.Error(ctx, err) @@ -6635,26 +6827,26 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context } return graphql.Null } - res := resTmp.(int) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) +func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friendID(ctx, field) if err != nil { return graphql.Null } @@ -6667,49 +6859,38 @@ func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.FriendID, 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.(*ent.Friendship) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", 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_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) +func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_user(ctx, field) if err != nil { return graphql.Null } @@ -6722,7 +6903,7 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.User(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6734,26 +6915,44 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(entgql.Cursor[pulid.ID]) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_id(ctx, field) +func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friend(ctx, field) if err != nil { return graphql.Null } @@ -6766,7 +6965,7 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Friend(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6778,26 +6977,44 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_name(ctx, field) +func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -6810,38 +7027,41 @@ func (ec *executionContext) _Group_name(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Edges, 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) + res := resTmp.([]*ent.FriendshipEdge) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendshipEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_FriendshipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FriendshipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_users(ctx, field) +func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -6854,7 +7074,7 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6866,45 +7086,36 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.PageInfo[pulid.ID]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) + 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 UserConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", 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_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) +func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -6917,41 +7128,38 @@ func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.GroupEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipConnection", 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_GroupEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_GroupEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) +func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -6964,48 +7172,49 @@ func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Node, 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[pulid.ID]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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) - }, - } + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + }, + } return fc, nil } -func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) +func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7018,7 +7227,7 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7030,26 +7239,26 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_node(ctx, field) +func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_id(ctx, field) if err != nil { return graphql.Null } @@ -7061,71 +7270,39 @@ func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - directive0 := func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - } - - directive1 := func(ctx context.Context) (any, error) { - permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) - if err != nil { - var zeroVal *ent.Group - return zeroVal, err - } - if ec.directives.HasPermissions == nil { - var zeroVal *ent.Group - return zeroVal, errors.New("directive hasPermissions is not implemented") - } - return ec.directives.HasPermissions(ctx, obj, directive0, permissions) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*ent.Group); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todopulid/ent.Group`, tmp) + 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.(*ent.Group) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroup(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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_Group_id(ctx, field) - case "name": - return ec.fieldContext_Group_name(ctx, field) - case "users": - return ec.fieldContext_Group_users(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) +func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_name(ctx, field) if err != nil { return graphql.Null } @@ -7138,7 +7315,7 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -7150,26 +7327,26 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(entgql.Cursor[pulid.ID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) +func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_users(ctx, field) if err != nil { return graphql.Null } @@ -7182,7 +7359,7 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) + return obj.Users(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7194,43 +7371,27 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field } return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Group", Field: field, IsMethod: true, - IsResolver: 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) }, } defer func() { @@ -7240,15 +7401,15 @@ func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) +func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -7261,83 +7422,41 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) + return obj.Edges, 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.(*ent.Todo) + res := resTmp.([]*ent.GroupEdge) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + case "node": + return ec.fieldContext_GroupEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) +func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -7350,7 +7469,7 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(pulid.ID), fc.Args["input"].(ent.UpdateTodoInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -7362,71 +7481,36 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*ent.Todo) + res := resTmp.(entgql.PageInfo[pulid.ID]) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + 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 Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) +func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -7439,7 +7523,7 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ClearTodos(rctx) + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -7456,12 +7540,12 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, @@ -7469,8 +7553,8 @@ func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, return fc, nil } -func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) +func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -7482,64 +7566,71 @@ func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(pulid.ID), fc.Args["input"].(UpdateFriendshipInput)) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + } + + directive1 := func(ctx context.Context) (any, error) { + permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) + if err != nil { + var zeroVal *ent.Group + return zeroVal, err + } + if ec.directives.HasPermissions == nil { + var zeroVal *ent.Group + return zeroVal, errors.New("directive hasPermissions is not implemented") + } + return ec.directives.HasPermissions(ctx, obj, directive0, permissions) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*ent.Group); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todopulid/ent.Group`, tmp) }) 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.Friendship) + res := resTmp.(*ent.Group) fc.Result = res - return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) + return ec.fieldContext_Group_id(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_id(ctx, field) +func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7552,7 +7643,7 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7564,26 +7655,26 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "GroupEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_name(ctx, field) +func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) if err != nil { return graphql.Null } @@ -7596,7 +7687,7 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) }) if err != nil { ec.Error(ctx, err) @@ -7608,67 +7699,61 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_field2(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 + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Field2, nil - }) - if err != nil { + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OneToMany", - 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, err } return fc, nil } -func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_parent(ctx, field) +func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) if err != nil { return graphql.Null } @@ -7681,47 +7766,83 @@ func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent, nil + return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) }) 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.(*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_children(ctx, field) +func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) if err != nil { return graphql.Null } @@ -7734,47 +7855,83 @@ func (ec *executionContext) _OneToMany_children(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children, nil + return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(pulid.ID), fc.Args["input"].(ent.UpdateTodoInput)) }) 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.([]*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyᚄ(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) +func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) if err != nil { return graphql.Null } @@ -7787,41 +7944,38 @@ func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return ec.resolvers.Mutation().ClearTodos(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*OneToManyEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_OneToManyEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_OneToManyEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) +func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) if err != nil { return graphql.Null } @@ -7834,7 +7988,7 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(pulid.ID), fc.Args["input"].(UpdateFriendshipInput)) }) if err != nil { ec.Error(ctx, err) @@ -7846,36 +8000,51 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f } return graphql.Null } - res := resTmp.(*entgql.PageInfo[pulid.ID]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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) + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) +func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_id(ctx, field) if err != nil { return graphql.Null } @@ -7888,7 +8057,7 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7900,26 +8069,26 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "OneToMany", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) +func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_name(ctx, field) if err != nil { return graphql.Null } @@ -7932,47 +8101,38 @@ func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*OneToMany) + res := resTmp.(string) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) +func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_field2(ctx, field) if err != nil { return graphql.Null } @@ -7985,38 +8145,35 @@ func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Field2, 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[pulid.ID]) + res := resTmp.(*string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_id(ctx, field) +func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_parent(ctx, field) if err != nil { return graphql.Null } @@ -8029,38 +8186,47 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Organization().ID(rctx, obj) + return obj.Parent, 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.(pulid.ID) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", Field: field, - IsMethod: true, - IsResolver: true, + 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_name(ctx, field) +func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_children(ctx, field) if err != nil { return graphql.Null } @@ -8073,38 +8239,47 @@ func (ec *executionContext) _Organization_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Children, 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) + res := resTmp.([]*OneToMany) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -8117,38 +8292,41 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.Edges, 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) + res := resTmp.([]*OneToManyEdge) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_OneToManyEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OneToManyEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) +func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -8161,7 +8339,7 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasPreviousPage, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -8173,26 +8351,36 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*entgql.PageInfo[pulid.ID]) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + 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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8205,35 +8393,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + 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.(*entgql.Cursor[pulid.ID]) + res := resTmp.(int) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) +func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8246,7 +8437,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) @@ -8255,26 +8446,38 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*entgql.Cursor[pulid.ID]) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_id(ctx, field) +func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8287,7 +8490,7 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8299,26 +8502,26 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "OneToManyEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_todos(ctx, field) +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_id(ctx, field) if err != nil { return graphql.Null } @@ -8331,7 +8534,7 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Todos, nil + return ec.resolvers.Organization().ID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8343,45 +8546,26 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Organization", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } 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) +func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_name(ctx, field) if err != nil { return graphql.Null } @@ -8394,50 +8578,42 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Node(rctx, fc.Args["id"].(pulid.ID)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(ent.Noder) + res := resTmp.(string) fc.Result = res - return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Organization", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_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) + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (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)) @@ -8446,7 +8622,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]pulid.ID)) + return obj.HasNextPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8458,37 +8634,26 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]ent.Noder) + res := resTmp.(bool) fc.Result = res - return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_billProducts(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -8501,7 +8666,7 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().BillProducts(rctx) + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8513,36 +8678,26 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*ent.BillProduct) + res := resTmp.(bool) fc.Result = res - return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_BillProduct_id(ctx, field) - case "name": - return ec.fieldContext_BillProduct_name(ctx, field) - case "sku": - return ec.fieldContext_BillProduct_sku(ctx, field) - case "quantity": - return ec.fieldContext_BillProduct_quantity(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BillProduct", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } 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) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -8555,57 +8710,35 @@ func (ec *executionContext) _Query_categories(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.CategoryOrder), fc.Args["where"].(*ent.CategoryWhereInput)) + return obj.StartCursor, 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.(*ent.CategoryConnection) + res := resTmp.(*entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, 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) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_categories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_groups(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[pulid.ID]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -8618,57 +8751,35 @@ func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.EndCursor, 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.(*ent.GroupConnection) + res := resTmp.(*entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_oneToMany(ctx, field) +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_id(ctx, field) if err != nil { return graphql.Null } @@ -8681,7 +8792,7 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8693,45 +8804,26 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*OneToManyConnection) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyConnection(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_OneToManyConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todos(ctx, field) +func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_todos(ctx, field) if err != nil { return graphql.Null } @@ -8744,7 +8836,7 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.Todos, nil }) if err != nil { ec.Error(ctx, err) @@ -8761,12 +8853,12 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": @@ -8786,15 +8878,15 @@ func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_users(ctx, field) +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 } @@ -8807,39 +8899,28 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(pulid.ID)) }) 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.UserConnection) + res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } defer func() { @@ -8849,15 +8930,15 @@ func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ping(ctx, field) +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 } @@ -8870,7 +8951,7 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ping(rctx) + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]pulid.ID)) }) if err != nil { ec.Error(ctx, err) @@ -8882,26 +8963,37 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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("field of type String does not have child fields") + 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_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) +func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_billProducts(ctx, field) if err != nil { return graphql.Null } @@ -8914,7 +9006,7 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return ec.resolvers.Query().BillProducts(rctx) }) if err != nil { ec.Error(ctx, err) @@ -8926,12 +9018,12 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.([]*ent.BillProduct) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -8939,32 +9031,23 @@ func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_BillProduct_id(ctx, field) + case "name": + return ec.fieldContext_BillProduct_name(ctx, field) + case "sku": + return ec.fieldContext_BillProduct_sku(ctx, field) + case "quantity": + return ec.fieldContext_BillProduct_quantity(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type BillProduct", 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_todosWithJoins_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) +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 } @@ -8977,50 +9060,39 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return ec.resolvers.Query().Categories(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), 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.(*introspection.Type) + res := resTmp.(*ent.CategoryConnection) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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: false, + IsResolver: true, 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) + 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 __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CategoryConnection", field.Name) }, } defer func() { @@ -9030,15 +9102,15 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _Query_directiveExamples(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_directiveExamples(ctx, field) if err != nil { return graphql.Null } @@ -9051,49 +9123,52 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return ec.resolvers.Query().DirectiveExamples(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]*DirectiveExample) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_directiveExamples(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, 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) + case "id": + return ec.fieldContext_DirectiveExample_id(ctx, field) + case "onTypeField": + return ec.fieldContext_DirectiveExample_onTypeField(ctx, field) + case "onMutationFields": + return ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) + case "onMutationCreate": + return ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) + case "onMutationUpdate": + return ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) + case "onAllFields": + return ec.fieldContext_DirectiveExample_onAllFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DirectiveExample", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_id(ctx, field) +func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groups(ctx, field) if err != nil { return graphql.Null } @@ -9106,7 +9181,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9118,26 +9193,45 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_createdAt(ctx, field) +func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oneToMany(ctx, field) if err != nil { return graphql.Null } @@ -9150,7 +9244,7 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return ec.resolvers.Query().OneToMany(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9162,26 +9256,45 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*OneToManyConnection) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐOneToManyConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_OneToManyConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", 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_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_status(ctx, field) +func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todos(ctx, field) if err != nil { return graphql.Null } @@ -9194,7 +9307,7 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().Status(rctx, obj) + return ec.resolvers.Query().Todos(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9206,26 +9319,45 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(todo.Status) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TodoStatus does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) +func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_users(ctx, field) if err != nil { return graphql.Null } @@ -9238,7 +9370,7 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Priority, nil + return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9250,26 +9382,45 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err } return fc, nil } -func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_text(ctx, field) +func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ping(ctx, field) if err != nil { return graphql.Null } @@ -9282,7 +9433,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Text, nil + return ec.resolvers.Query().Ping(rctx) }) if err != nil { ec.Error(ctx, err) @@ -9299,12 +9450,12 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -9312,8 +9463,8 @@ func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryID(ctx, field) +func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) if err != nil { return graphql.Null } @@ -9326,35 +9477,57 @@ func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.resolvers.Query().TodosWithJoins(rctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) 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.(pulid.ID) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todosWithJoins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category_id(ctx, field) +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 } @@ -9367,7 +9540,7 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -9376,26 +9549,59 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + 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) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryX(ctx, field) +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 } @@ -9408,7 +9614,7 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) @@ -9417,26 +9623,40 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(pulid.ID) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_init(ctx, field) +func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_id(ctx, field) if err != nil { return graphql.Null } @@ -9449,35 +9669,38 @@ func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Init, nil + 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.(map[string]interface{}) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_custom(ctx, field) +func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -9490,39 +9713,38 @@ func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Custom, nil + 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.([]customstruct.Custom) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_customp(ctx, field) +func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_status(ctx, field) if err != nil { return graphql.Null } @@ -9535,39 +9757,38 @@ func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Customp, nil + return ec.resolvers.Todo().Status(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*customstruct.Custom) + res := resTmp.(todo.Status) fc.Result = res - return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) + return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type TodoStatus does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_value(ctx, field) +func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) if err != nil { return graphql.Null } @@ -9580,7 +9801,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Value, nil + return obj.Priority, nil }) if err != nil { ec.Error(ctx, err) @@ -9597,7 +9818,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, @@ -9610,8 +9831,8 @@ func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field gra return fc, nil } -func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_parent(ctx, field) +func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_text(ctx, field) if err != nil { return graphql.Null } @@ -9624,69 +9845,38 @@ func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent(ctx) + return obj.Text, 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.(*ent.Todo) + res := resTmp.(string) fc.Result = res - return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_children(ctx, field) +func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryID(ctx, field) if err != nil { return graphql.Null } @@ -9699,57 +9889,76 @@ func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.CategoryID, 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.(*ent.TodoConnection) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CategoryID, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pulid.ID) + fc.Result = res + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Todo", + 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) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category(ctx, field) +func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryX(ctx, field) if err != nil { return graphql.Null } @@ -9762,7 +9971,7 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Category(ctx) + return obj.CategoryID, nil }) if err != nil { ec.Error(ctx, err) @@ -9771,50 +9980,26 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalOID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_extendedField(ctx, field) +func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_init(ctx, field) if err != nil { return graphql.Null } @@ -9827,7 +10012,7 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().ExtendedField(rctx, obj) + return obj.Init, nil }) if err != nil { ec.Error(ctx, err) @@ -9836,26 +10021,26 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) +func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_custom(ctx, field) if err != nil { return graphql.Null } @@ -9868,7 +10053,7 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Custom, nil }) if err != nil { ec.Error(ctx, err) @@ -9877,32 +10062,30 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.TodoEdge) + res := resTmp.([]customstruct.Custom) fc.Result = res - return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoEdge(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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_TodoEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_TodoEdge_cursor(ctx, field) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) +func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_customp(ctx, field) if err != nil { return graphql.Null } @@ -9915,48 +10098,39 @@ func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Customp, 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[pulid.ID]) + res := resTmp.([]*customstruct.Custom) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) +func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_value(ctx, field) if err != nil { return graphql.Null } @@ -9969,7 +10143,7 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -9986,9 +10160,9 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", Field: field, IsMethod: false, IsResolver: false, @@ -9999,8 +10173,8 @@ func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Con return fc, nil } -func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_node(ctx, field) +func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_parent(ctx, field) if err != nil { return graphql.Null } @@ -10013,7 +10187,7 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Parent(ctx) }) if err != nil { ec.Error(ctx, err) @@ -10027,11 +10201,11 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -10074,8 +10248,8 @@ func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field return fc, nil } -func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) +func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_children(ctx, field) if err != nil { return graphql.Null } @@ -10088,7 +10262,7 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Children(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].([]*ent.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10100,26 +10274,45 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[pulid.ID]) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_id(ctx, field) + 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_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category(ctx, field) if err != nil { return graphql.Null } @@ -10132,38 +10325,59 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Category(ctx) }) 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.(pulid.ID) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) + return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_name(ctx, field) +func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_extendedField(ctx, field) if err != nil { return graphql.Null } @@ -10176,29 +10390,26 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Todo().ExtendedField(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -10206,8 +10417,8 @@ func (ec *executionContext) fieldContext_User_name(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_username(ctx, field) +func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10220,38 +10431,41 @@ func (ec *executionContext) _User_username(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Username(rctx, obj) + return obj.Edges, 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) + res := resTmp.([]*ent.TodoEdge) fc.Result = res - return ec.marshalNUUID2string(ctx, field.Selections, res) + return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_TodoEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TodoEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) +func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10264,7 +10478,7 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.RequiredMetadata, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10276,26 +10490,36 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(entgql.PageInfo[pulid.ID]) fc.Result = res - return ec.marshalNMap2map(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + 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) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_metadata(ctx, field) +func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10308,35 +10532,38 @@ func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Metadata, nil + 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.(map[string]interface{}) + res := resTmp.(int) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_groups(ctx, field) +func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -10349,57 +10576,69 @@ func (ec *executionContext) _User_groups(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) + return obj.Node, 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.(*ent.GroupConnection) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friends(ctx, field) +func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -10412,7 +10651,7 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friends(rctx, obj, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -10424,45 +10663,26 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friendships(ctx, field) +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) if err != nil { return graphql.Null } @@ -10475,7 +10695,7 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -10487,45 +10707,26 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*ent.FriendshipConnection) + res := resTmp.(pulid.ID) fc.Result = res - return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendshipConnection(ctx, field.Selections, res) + return ec.marshalNID2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "User", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_FriendshipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_edges(ctx, field) +func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_name(ctx, field) if err != nil { return graphql.Null } @@ -10538,41 +10739,38 @@ func (ec *executionContext) _UserConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*ent.UserEdge) + res := resTmp.(string) fc.Result = res - return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserEdge(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", 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_UserEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_UserEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) +func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_username(ctx, field) if err != nil { return graphql.Null } @@ -10585,7 +10783,7 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.User().Username(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -10597,36 +10795,26 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.PageInfo[pulid.ID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNUUID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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 nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) +func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) if err != nil { return graphql.Null } @@ -10639,7 +10827,7 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.RequiredMetadata, nil }) if err != nil { ec.Error(ctx, err) @@ -10651,26 +10839,26 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(int) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_node(ctx, field) +func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(ctx, field) if err != nil { return graphql.Null } @@ -10683,7 +10871,7 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -10692,44 +10880,26 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.User) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", 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_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) +func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groups(ctx, field) if err != nil { return graphql.Null } @@ -10742,7 +10912,7 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Groups(ctx, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10754,26 +10924,45 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[pulid.ID]) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friends(ctx, field) if err != nil { return graphql.Null } @@ -10786,7 +10975,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.User().Friends(rctx, obj, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["orderBy"].(*ent.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10798,26 +10987,45 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friendships(ctx, field) if err != nil { return graphql.Null } @@ -10830,35 +11038,57 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[pulid.ID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[pulid.ID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) }) 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) + res := resTmp.(*ent.FriendshipConnection) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐFriendshipConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_FriendshipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) + 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_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10871,38 +11101,41 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Edges, 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) + res := resTmp.([]*ent.UserEdge) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUserEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_UserEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10915,7 +11148,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10927,36 +11160,36 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(entgql.PageInfo[pulid.ID]) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "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 __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10969,7 +11202,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -10981,26 +11214,26 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -11013,38 +11246,53 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Node, 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) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -11057,35 +11305,38 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + 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.(*string) + res := resTmp.(entgql.Cursor[pulid.ID]) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -11098,7 +11349,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11110,26 +11361,26 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -11142,7 +11393,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11156,9 +11407,9 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, IsMethod: true, IsResolver: false, @@ -11169,8 +11420,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -11183,7 +11434,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) @@ -11195,26 +11446,26 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -11227,35 +11478,48 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, - IsMethod: true, + 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -11268,7 +11532,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -11280,36 +11544,26 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11322,7 +11576,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11334,48 +11588,67 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11405,9 +11678,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11418,8 +11691,8 @@ func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11446,9 +11719,9 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11459,8 +11732,8 @@ func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Con return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -11490,9 +11763,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, @@ -11503,8 +11776,8 @@ func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -11531,9 +11804,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, @@ -11544,8 +11817,62 @@ func (ec *executionContext) fieldContext___InputValue_description(_ context.Cont return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -11575,9 +11902,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, @@ -11610,8 +11937,8 @@ func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11624,35 +11951,38 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11665,7 +11995,7 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -11679,9 +12009,9 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, @@ -11692,8 +12022,8 @@ func (ec *executionContext) fieldContext___Schema_description(_ context.Context, return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11706,7 +12036,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11718,48 +12048,26 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11772,60 +12080,35 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", 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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -11838,25 +12121,28 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -11887,8 +12173,8 @@ func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -11901,7 +12187,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -11910,48 +12196,26 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) if err != nil { return graphql.Null } @@ -11964,50 +12228,35 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) if err != nil { return graphql.Null } @@ -12020,7 +12269,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Types(), nil }) if err != nil { ec.Error(ctx, err) @@ -12032,26 +12281,48 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) if err != nil { return graphql.Null } @@ -12064,35 +12335,60 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.QueryType(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) if err != nil { return graphql.Null } @@ -12105,7 +12401,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.MutationType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12114,26 +12410,48 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } @@ -12146,7 +12464,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.SubscriptionType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12155,51 +12473,48 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Field_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + return 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) + }, } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) if err != nil { return graphql.Null } @@ -12212,57 +12527,50 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.Directives(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]introspection.Directive) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Type_name(ctx, field) + return ec.fieldContext___Directive_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 ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) if err != nil { return graphql.Null } @@ -12275,57 +12583,38 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.Kind(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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) + return nil, errors.New("field of type __TypeKind does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) if err != nil { return graphql.Null } @@ -12338,7 +12627,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.Name(), nil }) if err != nil { ec.Error(ctx, err) @@ -12347,47 +12636,67 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) if err != nil { return graphql.Null } @@ -12400,7 +12709,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -12409,12 +12718,12 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.([]introspection.Field) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12423,22 +12732,37 @@ func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, f Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": - return ec.fieldContext___InputValue_name(ctx, field) + return ec.fieldContext___Field_name(ctx, field) case "description": - return ec.fieldContext___InputValue_description(ctx, field) + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) if err != nil { return graphql.Null } @@ -12451,7 +12775,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Interfaces(), nil }) if err != nil { ec.Error(ctx, err) @@ -12460,12 +12784,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12500,8 +12824,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) if err != nil { return graphql.Null } @@ -12514,7 +12838,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.PossibleTypes(), nil }) if err != nil { ec.Error(ctx, err) @@ -12523,463 +12847,1512 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { - var it ent.BillProductWhereInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] + 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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { + var it ent.BillProductWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} + 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.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = 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 "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 "sku": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sku = data + case "skuNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuNEQ = data + case "skuIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuIn = data + case "skuNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuNotIn = data + case "skuGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGT = data + case "skuGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGTE = data + case "skuLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLT = data + case "skuLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLTE = data + case "skuContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContains = data + case "skuHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasPrefix = data + case "skuHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasSuffix = data + case "skuEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuEqualFold = data + case "skuContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContainsFold = data + case "quantity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.Quantity = data + case "quantityNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityNEQ = data + case "quantityIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityIn = data + case "quantityNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityNotIn = data + case "quantityGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGT = data + case "quantityGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGTE = data + case "quantityLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLT = data + case "quantityLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLTE = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { + var it schematype.CategoryConfig + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"maxMembers"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "maxMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) + data, err := ec.unmarshalOInt2int(ctx, v) + if err != nil { + return it, err + } + it.MaxMembers = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { + var it ent.CategoryOrder + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + 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ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (CategoryTypesInput, error) { + var it CategoryTypesInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"public"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "public": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Public = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { + var it ent.CategoryWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} + 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.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInput(ctx, v) + data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋ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ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.ID = data + case "idNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDNEQ = data + case "idIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDIn = data + case "idNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.IDNotIn = data + case "idGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDGT = data + case "idGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDGTE = data + case "idLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDLT = data + case "idLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "textNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextNEQ = data + case "textIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextIn = data + case "textNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextNotIn = data + case "textGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGT = data + case "textGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGTE = data + case "textLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLT = data + case "textLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLTE = data + case "textContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContains = data + case "textHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasPrefix = data + case "textHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.TextHasSuffix = data + case "textEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.TextEqualFold = data + case "textContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Or = data - case "id": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.TextContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.ID = data - case "idNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.IDNEQ = data - case "idIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatusᚄ(ctx, v) if err != nil { return it, err } - it.IDIn = data - case "idNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNotIn")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatusᚄ(ctx, v) if err != nil { return it, err } - it.IDNotIn = data - case "idGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGT")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.StatusNotIn = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDGT = data - case "idGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.Config = data + case "configNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.IDGTE = data - case "idLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.ConfigNEQ = data + case "configIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) if err != nil { return it, err } - it.IDLT = data - case "idLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.ConfigIn = data + case "configNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.ConfigNotIn = data + case "configGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigGT = data + case "configGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigGTE = data + case "configLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigLT = data + case "configLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigLTE = data + case "configIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigIsNil = data + case "configNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigNotNil = data + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.Duration = data + case "durationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationNEQ = data + case "durationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationIn = data + case "durationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationNotIn = data + case "durationGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationGT = data + case "durationGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationGTE = data + case "durationLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "sku": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationLT = data + case "durationLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.Sku = data - case "skuNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationLTE = data + case "durationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuNEQ = data - case "skuIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.DurationIsNil = data + case "durationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DurationNotNil = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.Count = data + case "countNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountNEQ = data + case "countIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountIn = data + case "countNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountNotIn = data + case "countGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGT = data + case "countGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGTE = data + case "countLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.SkuIn = data - case "skuNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.CountLT = data + case "countLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.SkuNotIn = data - case "skuGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountLTE = data + case "countIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuGT = data - case "skuGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountIsNil = data + case "countNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuGTE = data - case "skuLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountNotNil = data + case "hasTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuLT = data - case "skuLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasTodos = data + case "hasTodosWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) + data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuLTE = data - case "skuContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasTodosWith = data + case "hasSubCategories": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuContains = data - case "skuHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategories = data + case "hasSubCategoriesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) + data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuHasPrefix = data - case "skuHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategoriesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { + var it ent.CreateCategoryInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.SkuHasSuffix = data - case "skuEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Text = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.SkuEqualFold = data - case "skuContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Status = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.SkuContainsFold = data - case "quantity": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Config = data + case "types": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) + data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐCategoryTypesInput(ctx, v) if err != nil { return it, err } - it.Quantity = data - case "quantityNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) - if err != nil { + if err = ec.resolvers.CreateCategoryInput().Types(ctx, &it, data); err != nil { return it, err } - it.QuantityNEQ = data - case "quantityIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.QuantityIn = data - case "quantityNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.Duration = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.QuantityNotIn = data - case "quantityGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Count = data + case "strings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.QuantityGT = data - case "quantityGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Strings = data + case "todoIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) if err != nil { return it, err } - it.QuantityGTE = data - case "quantityLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.TodoIDs = data + case "subCategoryIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) if err != nil { return it, err } - it.QuantityLT = data - case "quantityLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.SubCategoryIDs = data + case "createTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) + data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCreateTodoInputᚄ(ctx, v) if err != nil { return it, err } - it.QuantityLTE = data + if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { + return it, err + } } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { - var it schematype.CategoryConfig +func (ec *executionContext) unmarshalInputCreateDirectiveExampleInput(ctx context.Context, obj any) (CreateDirectiveExampleInput, error) { + var it CreateDirectiveExampleInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"maxMembers"} + fieldsInOrder := [...]string{"onTypeField", "onMutationFields", "onMutationCreate", "onMutationUpdate", "onAllFields"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "maxMembers": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) - data, err := ec.unmarshalOInt2int(ctx, v) + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.MaxMembers = data + it.OnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationCreate = data + } else if tmp == nil { + it.OnMutationCreate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdate = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { - var it ent.CategoryOrder +func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { + var it ent.CreateTodoInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} + fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} 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) + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { + return it, err + } + case "priority": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Priority = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "init": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Init = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Value = data + case "parentID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.ParentID = data + case "childIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) if err != nil { return it, err } - it.Direction = data - case "field": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNCategoryOrderField2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryOrderField(ctx, v) + it.ChildIDs = data + case "categoryID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) if err != nil { return it, err } - it.Field = data + it.CategoryID = data + case "secretID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) + data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + if err != nil { + return it, err + } + it.SecretID = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (CategoryTypesInput, error) { - var it CategoryTypesInput +func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { + var it ent.CreateUserInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"public"} + fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "public": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Public = data + it.Name = data + case "username": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateUserInput().Username(ctx, &it, data); err != nil { + return it, err + } + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Password = data + case "requiredMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) + data, err := ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + it.RequiredMetadata = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "friendIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) + data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.FriendIDs = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { - var it ent.CategoryWhereInput +func (ec *executionContext) unmarshalInputDirectiveExampleWhereInput(ctx context.Context, obj any) (DirectiveExampleWhereInput, error) { + var it DirectiveExampleWhereInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "onTypeField", "onTypeFieldNEQ", "onTypeFieldIn", "onTypeFieldNotIn", "onTypeFieldGT", "onTypeFieldGTE", "onTypeFieldLT", "onTypeFieldLTE", "onTypeFieldContains", "onTypeFieldHasPrefix", "onTypeFieldHasSuffix", "onTypeFieldIsNil", "onTypeFieldNotNil", "onTypeFieldEqualFold", "onTypeFieldContainsFold", "onMutationFields", "onMutationFieldsNEQ", "onMutationFieldsIn", "onMutationFieldsNotIn", "onMutationFieldsGT", "onMutationFieldsGTE", "onMutationFieldsLT", "onMutationFieldsLTE", "onMutationFieldsContains", "onMutationFieldsHasPrefix", "onMutationFieldsHasSuffix", "onMutationFieldsIsNil", "onMutationFieldsNotNil", "onMutationFieldsEqualFold", "onMutationFieldsContainsFold", "onMutationCreate", "onMutationCreateNEQ", "onMutationCreateIn", "onMutationCreateNotIn", "onMutationCreateGT", "onMutationCreateGTE", "onMutationCreateLT", "onMutationCreateLTE", "onMutationCreateContains", "onMutationCreateHasPrefix", "onMutationCreateHasSuffix", "onMutationCreateIsNil", "onMutationCreateNotNil", "onMutationCreateEqualFold", "onMutationCreateContainsFold", "onMutationUpdate", "onMutationUpdateNEQ", "onMutationUpdateIn", "onMutationUpdateNotIn", "onMutationUpdateGT", "onMutationUpdateGTE", "onMutationUpdateLT", "onMutationUpdateLTE", "onMutationUpdateContains", "onMutationUpdateHasPrefix", "onMutationUpdateHasSuffix", "onMutationUpdateIsNil", "onMutationUpdateNotNil", "onMutationUpdateEqualFold", "onMutationUpdateContainsFold", "onAllFields", "onAllFieldsNEQ", "onAllFieldsIn", "onAllFieldsNotIn", "onAllFieldsGT", "onAllFieldsGTE", "onAllFieldsLT", "onAllFieldsLTE", "onAllFieldsContains", "onAllFieldsHasPrefix", "onAllFieldsHasSuffix", "onAllFieldsIsNil", "onAllFieldsNotNil", "onAllFieldsEqualFold", "onAllFieldsContainsFold"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -12988,21 +14361,21 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context switch k { case "not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryWhereInput(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInput(ctx, v) if err != nil { return it, err } it.Not = data case "and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } it.And = data case "or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -13020,7 +14393,7 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context if err != nil { return it, err } - it.IDNEQ = data + it.IDNeq = data case "idIn": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) @@ -13041,635 +14414,553 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context if err != nil { return it, err } - it.IDGT = data + it.IDGt = data case "idGTE": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idGTE")) data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) if err != nil { return it, err } - it.IDGTE = data + it.IDGte = data case "idLT": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLT")) data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) if err != nil { return it, err } - it.IDLT = data + it.IDLt = data case "idLTE": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idLTE")) data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.IDLte = data + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Text = data - case "textNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + it.OnTypeField = data + case "onTypeFieldNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextNEQ = data - case "textIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + it.OnTypeFieldNeq = data + case "onTypeFieldIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextIn = data - case "textNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + it.OnTypeFieldIn = data + case "onTypeFieldNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextNotIn = data - case "textGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGT = data - case "textGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGTE = data - case "textLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + it.OnTypeFieldNotIn = data + case "onTypeFieldGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLT = data - case "textLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + it.OnTypeFieldGt = data + case "onTypeFieldGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLTE = data - case "textContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + it.OnTypeFieldGte = data + case "onTypeFieldLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContains = data - case "textHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + it.OnTypeFieldLt = data + case "onTypeFieldLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasPrefix = data - case "textHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + it.OnTypeFieldLte = data + case "onTypeFieldContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasSuffix = data - case "textEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + it.OnTypeFieldContains = data + case "onTypeFieldHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextEqualFold = data - case "textContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + it.OnTypeFieldHasPrefix = data + case "onTypeFieldHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContainsFold = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.Status = data - case "statusNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.StatusNEQ = data - case "statusIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusIn = data - case "statusNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusNotIn = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.Config = data - case "configNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.ConfigNEQ = data - case "configIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) - if err != nil { - return it, err - } - it.ConfigIn = data - case "configNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) + it.OnTypeFieldHasSuffix = data + case "onTypeFieldIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.ConfigNotIn = data - case "configGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldIsNil = data + case "onTypeFieldNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.ConfigGT = data - case "configGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldNotNil = data + case "onTypeFieldEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigGTE = data - case "configLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldEqualFold = data + case "onTypeFieldContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLT = data - case "configLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldContainsFold = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLTE = data - case "configIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFields = data + case "onMutationFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigIsNil = data - case "configNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsNeq = data + case "onMutationFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.ConfigNotNil = data - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsIn = data + case "onMutationFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Duration = data - case "durationNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsNotIn = data + case "onMutationFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNEQ = data - case "durationIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGt = data + case "onMutationFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationIn = data - case "durationNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGte = data + case "onMutationFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNotIn = data - case "durationGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLt = data + case "onMutationFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGT = data - case "durationGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLte = data + case "onMutationFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGTE = data - case "durationLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsContains = data + case "onMutationFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLT = data - case "durationLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsHasPrefix = data + case "onMutationFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLTE = data - case "durationIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsHasSuffix = data + case "onMutationFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.DurationIsNil = data - case "durationNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsIsNil = data + case "onMutationFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.DurationNotNil = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsNotNil = data + case "onMutationFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Count = data - case "countNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsEqualFold = data + case "onMutationFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNEQ = data - case "countIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationFieldsContainsFold = data + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIn = data - case "countNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationCreate = data + case "onMutationCreateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotIn = data - case "countGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNeq = data + case "onMutationCreateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGT = data - case "countGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateIn = data + case "onMutationCreateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGTE = data - case "countLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNotIn = data + case "onMutationCreateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLT = data - case "countLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateGt = data + case "onMutationCreateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLTE = data - case "countIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateGte = data + case "onMutationCreateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIsNil = data - case "countNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateLt = data + case "onMutationCreateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotNil = data - case "hasTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateLte = data + case "onMutationCreateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodos = data - case "hasTodosWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) - data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐTodoWhereInputᚄ(ctx, v) + it.OnMutationCreateContains = data + case "onMutationCreateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodosWith = data - case "hasSubCategories": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateHasPrefix = data + case "onMutationCreateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasSubCategories = data - case "hasSubCategoriesWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCategoryWhereInputᚄ(ctx, v) + it.OnMutationCreateHasSuffix = data + case "onMutationCreateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasSubCategoriesWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { - var it ent.CreateCategoryInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationCreateIsNil = data + case "onMutationCreateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Text = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋcategoryᚐStatus(ctx, v) + it.OnMutationCreateNotNil = data + case "onMutationCreateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Status = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnMutationCreateEqualFold = data + case "onMutationCreateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Config = data - case "types": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) - data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐCategoryTypesInput(ctx, v) + it.OnMutationCreateContainsFold = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateCategoryInput().Types(ctx, &it, data); err != nil { + it.OnMutationUpdate = data + case "onMutationUpdateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationUpdateNeq = data + case "onMutationUpdateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Duration = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationUpdateIn = data + case "onMutationUpdateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Count = data - case "strings": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.OnMutationUpdateNotIn = data + case "onMutationUpdateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Strings = data - case "todoIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.OnMutationUpdateGt = data + case "onMutationUpdateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TodoIDs = data - case "subCategoryIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.OnMutationUpdateGte = data + case "onMutationUpdateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SubCategoryIDs = data - case "createTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) - data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚐCreateTodoInputᚄ(ctx, v) + it.OnMutationUpdateLt = data + case "onMutationUpdateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { + it.OnMutationUpdateLte = data + case "onMutationUpdateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { - var it ent.CreateTodoInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + it.OnMutationUpdateContains = data + case "onMutationUpdateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { + it.OnMutationUpdateHasPrefix = data + case "onMutationUpdateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "priority": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateHasSuffix = data + case "onMutationUpdateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Priority = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationUpdateIsNil = data + case "onMutationUpdateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Text = data - case "init": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnMutationUpdateNotNil = data + case "onMutationUpdateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Init = data - case "value": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateEqualFold = data + case "onMutationUpdateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Value = data - case "parentID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.OnMutationUpdateContainsFold = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ParentID = data - case "childIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.OnAllFields = data + case "onAllFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ChildIDs = data - case "categoryID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.OnAllFieldsNeq = data + case "onAllFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CategoryID = data - case "secretID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) - data, err := ec.unmarshalOID2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐID(ctx, v) + it.OnAllFieldsIn = data + case "onAllFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.SecretID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { - var it ent.CreateUserInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.OnAllFieldsNotIn = data + case "onAllFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsGt = data + case "onAllFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "username": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) - data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + it.OnAllFieldsGte = data + case "onAllFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateUserInput().Username(ctx, &it, data); err != nil { + it.OnAllFieldsLt = data + case "onAllFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "password": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + it.OnAllFieldsLte = data + case "onAllFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Password = data - case "requiredMetadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) - data, err := ec.unmarshalNMap2map(ctx, v) + it.OnAllFieldsContains = data + case "onAllFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.RequiredMetadata = data - case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnAllFieldsHasPrefix = data + case "onAllFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Metadata = data - case "groupIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.OnAllFieldsHasSuffix = data + case "onAllFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.GroupIDs = data - case "friendIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) - data, err := ec.unmarshalOID2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚋentᚋschemaᚋpulidᚐIDᚄ(ctx, v) + it.OnAllFieldsIsNil = data + case "onAllFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.FriendIDs = data + it.OnAllFieldsNotNil = data + case "onAllFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsEqualFold = data + case "onAllFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsContainsFold = data } } @@ -15367,6 +16658,198 @@ func (ec *executionContext) unmarshalInputUpdateCategoryInput(ctx context.Contex return it, nil } +func (ec *executionContext) unmarshalInputUpdateDirectiveExampleInput(ctx context.Context, obj any) (UpdateDirectiveExampleInput, error) { + var it UpdateDirectiveExampleInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"onTypeField", "clearOnTypeField", "onMutationFields", "clearOnMutationFields", "onMutationCreate", "clearOnMutationCreate", "onMutationUpdate", "clearOnMutationUpdate", "onAllFields", "clearOnAllFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeField = data + case "clearOnTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnTypeField")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationFields = data + } else if tmp == nil { + it.ClearOnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreate = data + case "clearOnMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationCreate")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnMutationCreate = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationUpdate = data + } else if tmp == nil { + it.OnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationUpdate = data + } else if tmp == nil { + it.ClearOnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnAllFields = data + } else if tmp == nil { + it.ClearOnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputUpdateFriendshipInput(ctx context.Context, obj any) (UpdateFriendshipInput, error) { var it UpdateFriendshipInput asMap := map[string]any{} @@ -16011,6 +17494,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Category(ctx, sel, obj) + case DirectiveExample: + return ec._DirectiveExample(ctx, sel, &obj) + case *DirectiveExample: + if obj == nil { + return graphql.Null + } + return ec._DirectiveExample(ctx, sel, obj) case *ent.Friendship: if obj == nil { return graphql.Null @@ -16501,6 +17991,55 @@ func (ec *executionContext) _Custom(ctx context.Context, sel ast.SelectionSet, o return out } +var directiveExampleImplementors = []string{"DirectiveExample", "Node"} + +func (ec *executionContext) _DirectiveExample(ctx context.Context, sel ast.SelectionSet, obj *DirectiveExample) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, directiveExampleImplementors) + + 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("DirectiveExample") + case "id": + out.Values[i] = ec._DirectiveExample_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "onTypeField": + out.Values[i] = ec._DirectiveExample_onTypeField(ctx, field, obj) + case "onMutationFields": + out.Values[i] = ec._DirectiveExample_onMutationFields(ctx, field, obj) + case "onMutationCreate": + out.Values[i] = ec._DirectiveExample_onMutationCreate(ctx, field, obj) + case "onMutationUpdate": + out.Values[i] = ec._DirectiveExample_onMutationUpdate(ctx, field, obj) + case "onAllFields": + out.Values[i] = ec._DirectiveExample_onAllFields(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 friendshipImplementors = []string{"Friendship", "Node"} func (ec *executionContext) _Friendship(ctx context.Context, sel ast.SelectionSet, obj *ent.Friendship) graphql.Marshaler { @@ -17365,6 +18904,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "directiveExamples": + 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_directiveExamples(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 "groups": field := field @@ -18638,6 +20199,65 @@ func (ec *executionContext) marshalNCustom2entgoᚗioᚋcontribᚋentgqlᚋinter return ec._Custom(ctx, sel, &v) } +func (ec *executionContext) marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleᚄ(ctx context.Context, sel ast.SelectionSet, v []*DirectiveExample) 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.marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExample(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExample(ctx context.Context, sel ast.SelectionSet, v *DirectiveExample) 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._DirectiveExample(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNDuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) @@ -19779,6 +21399,34 @@ func (ec *executionContext) marshalOCustom2ᚖentgoᚗioᚋcontribᚋentgqlᚋin return ec._Custom(ctx, sel, v) } +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInputᚄ(ctx context.Context, v any) ([]*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []any + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*DirectiveExampleWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodopulidᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalODuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/entgql/internal/todopulid/models_gen.go b/entgql/internal/todopulid/models_gen.go index de0adce27..0fdcf60ff 100644 --- a/entgql/internal/todopulid/models_gen.go +++ b/entgql/internal/todopulid/models_gen.go @@ -25,6 +25,124 @@ type CategoryTypesInput struct { Public *bool `json:"public,omitempty"` } +// CreateDirectiveExampleInput is used for create DirectiveExample object. +// Input was generated by ent. +type CreateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + +type DirectiveExample struct { + ID pulid.ID `json:"id"` + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + +func (DirectiveExample) IsNode() {} + +// DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +// Input was generated by ent. +type DirectiveExampleWhereInput struct { + Not *DirectiveExampleWhereInput `json:"not,omitempty"` + And []*DirectiveExampleWhereInput `json:"and,omitempty"` + Or []*DirectiveExampleWhereInput `json:"or,omitempty"` + // id field predicates + ID *pulid.ID `json:"id,omitempty"` + IDNeq *pulid.ID `json:"idNEQ,omitempty"` + IDIn []pulid.ID `json:"idIn,omitempty"` + IDNotIn []pulid.ID `json:"idNotIn,omitempty"` + IDGt *pulid.ID `json:"idGT,omitempty"` + IDGte *pulid.ID `json:"idGTE,omitempty"` + IDLt *pulid.ID `json:"idLT,omitempty"` + IDLte *pulid.ID `json:"idLTE,omitempty"` + // on_type_field field predicates + OnTypeField *string `json:"onTypeField,omitempty"` + OnTypeFieldNeq *string `json:"onTypeFieldNEQ,omitempty"` + OnTypeFieldIn []string `json:"onTypeFieldIn,omitempty"` + OnTypeFieldNotIn []string `json:"onTypeFieldNotIn,omitempty"` + OnTypeFieldGt *string `json:"onTypeFieldGT,omitempty"` + OnTypeFieldGte *string `json:"onTypeFieldGTE,omitempty"` + OnTypeFieldLt *string `json:"onTypeFieldLT,omitempty"` + OnTypeFieldLte *string `json:"onTypeFieldLTE,omitempty"` + OnTypeFieldContains *string `json:"onTypeFieldContains,omitempty"` + OnTypeFieldHasPrefix *string `json:"onTypeFieldHasPrefix,omitempty"` + OnTypeFieldHasSuffix *string `json:"onTypeFieldHasSuffix,omitempty"` + OnTypeFieldIsNil *bool `json:"onTypeFieldIsNil,omitempty"` + OnTypeFieldNotNil *bool `json:"onTypeFieldNotNil,omitempty"` + OnTypeFieldEqualFold *string `json:"onTypeFieldEqualFold,omitempty"` + OnTypeFieldContainsFold *string `json:"onTypeFieldContainsFold,omitempty"` + // on_mutation_fields field predicates + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationFieldsNeq *string `json:"onMutationFieldsNEQ,omitempty"` + OnMutationFieldsIn []string `json:"onMutationFieldsIn,omitempty"` + OnMutationFieldsNotIn []string `json:"onMutationFieldsNotIn,omitempty"` + OnMutationFieldsGt *string `json:"onMutationFieldsGT,omitempty"` + OnMutationFieldsGte *string `json:"onMutationFieldsGTE,omitempty"` + OnMutationFieldsLt *string `json:"onMutationFieldsLT,omitempty"` + OnMutationFieldsLte *string `json:"onMutationFieldsLTE,omitempty"` + OnMutationFieldsContains *string `json:"onMutationFieldsContains,omitempty"` + OnMutationFieldsHasPrefix *string `json:"onMutationFieldsHasPrefix,omitempty"` + OnMutationFieldsHasSuffix *string `json:"onMutationFieldsHasSuffix,omitempty"` + OnMutationFieldsIsNil *bool `json:"onMutationFieldsIsNil,omitempty"` + OnMutationFieldsNotNil *bool `json:"onMutationFieldsNotNil,omitempty"` + OnMutationFieldsEqualFold *string `json:"onMutationFieldsEqualFold,omitempty"` + OnMutationFieldsContainsFold *string `json:"onMutationFieldsContainsFold,omitempty"` + // on_mutation_create field predicates + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationCreateNeq *string `json:"onMutationCreateNEQ,omitempty"` + OnMutationCreateIn []string `json:"onMutationCreateIn,omitempty"` + OnMutationCreateNotIn []string `json:"onMutationCreateNotIn,omitempty"` + OnMutationCreateGt *string `json:"onMutationCreateGT,omitempty"` + OnMutationCreateGte *string `json:"onMutationCreateGTE,omitempty"` + OnMutationCreateLt *string `json:"onMutationCreateLT,omitempty"` + OnMutationCreateLte *string `json:"onMutationCreateLTE,omitempty"` + OnMutationCreateContains *string `json:"onMutationCreateContains,omitempty"` + OnMutationCreateHasPrefix *string `json:"onMutationCreateHasPrefix,omitempty"` + OnMutationCreateHasSuffix *string `json:"onMutationCreateHasSuffix,omitempty"` + OnMutationCreateIsNil *bool `json:"onMutationCreateIsNil,omitempty"` + OnMutationCreateNotNil *bool `json:"onMutationCreateNotNil,omitempty"` + OnMutationCreateEqualFold *string `json:"onMutationCreateEqualFold,omitempty"` + OnMutationCreateContainsFold *string `json:"onMutationCreateContainsFold,omitempty"` + // on_mutation_update field predicates + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnMutationUpdateNeq *string `json:"onMutationUpdateNEQ,omitempty"` + OnMutationUpdateIn []string `json:"onMutationUpdateIn,omitempty"` + OnMutationUpdateNotIn []string `json:"onMutationUpdateNotIn,omitempty"` + OnMutationUpdateGt *string `json:"onMutationUpdateGT,omitempty"` + OnMutationUpdateGte *string `json:"onMutationUpdateGTE,omitempty"` + OnMutationUpdateLt *string `json:"onMutationUpdateLT,omitempty"` + OnMutationUpdateLte *string `json:"onMutationUpdateLTE,omitempty"` + OnMutationUpdateContains *string `json:"onMutationUpdateContains,omitempty"` + OnMutationUpdateHasPrefix *string `json:"onMutationUpdateHasPrefix,omitempty"` + OnMutationUpdateHasSuffix *string `json:"onMutationUpdateHasSuffix,omitempty"` + OnMutationUpdateIsNil *bool `json:"onMutationUpdateIsNil,omitempty"` + OnMutationUpdateNotNil *bool `json:"onMutationUpdateNotNil,omitempty"` + OnMutationUpdateEqualFold *string `json:"onMutationUpdateEqualFold,omitempty"` + OnMutationUpdateContainsFold *string `json:"onMutationUpdateContainsFold,omitempty"` + // on_all_fields field predicates + OnAllFields *string `json:"onAllFields,omitempty"` + OnAllFieldsNeq *string `json:"onAllFieldsNEQ,omitempty"` + OnAllFieldsIn []string `json:"onAllFieldsIn,omitempty"` + OnAllFieldsNotIn []string `json:"onAllFieldsNotIn,omitempty"` + OnAllFieldsGt *string `json:"onAllFieldsGT,omitempty"` + OnAllFieldsGte *string `json:"onAllFieldsGTE,omitempty"` + OnAllFieldsLt *string `json:"onAllFieldsLT,omitempty"` + OnAllFieldsLte *string `json:"onAllFieldsLTE,omitempty"` + OnAllFieldsContains *string `json:"onAllFieldsContains,omitempty"` + OnAllFieldsHasPrefix *string `json:"onAllFieldsHasPrefix,omitempty"` + OnAllFieldsHasSuffix *string `json:"onAllFieldsHasSuffix,omitempty"` + OnAllFieldsIsNil *bool `json:"onAllFieldsIsNil,omitempty"` + OnAllFieldsNotNil *bool `json:"onAllFieldsNotNil,omitempty"` + OnAllFieldsEqualFold *string `json:"onAllFieldsEqualFold,omitempty"` + OnAllFieldsContainsFold *string `json:"onAllFieldsContainsFold,omitempty"` +} + type OneToMany struct { ID pulid.ID `json:"id"` Name string `json:"name"` @@ -172,6 +290,21 @@ type ProjectWhereInput struct { HasTodosWith []*ent.TodoWhereInput `json:"hasTodosWith,omitempty"` } +// UpdateDirectiveExampleInput is used for update DirectiveExample object. +// Input was generated by ent. +type UpdateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + ClearOnTypeField *bool `json:"clearOnTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + ClearOnMutationFields *bool `json:"clearOnMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + ClearOnMutationCreate *bool `json:"clearOnMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + ClearOnMutationUpdate *bool `json:"clearOnMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` + ClearOnAllFields *bool `json:"clearOnAllFields,omitempty"` +} + // UpdateFriendshipInput is used for update Friendship object. // Input was generated by ent. type UpdateFriendshipInput struct { diff --git a/entgql/internal/todouuid/ent.resolvers.go b/entgql/internal/todouuid/ent.resolvers.go index 665ab35e6..b9da9fde3 100644 --- a/entgql/internal/todouuid/ent.resolvers.go +++ b/entgql/internal/todouuid/ent.resolvers.go @@ -59,6 +59,11 @@ func (r *queryResolver) Categories(ctx context.Context, after *entgql.Cursor[uui panic(fmt.Errorf("not implemented")) } +// DirectiveExamples is the resolver for the directiveExamples field. +func (r *queryResolver) DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) { + panic(fmt.Errorf("not implemented: DirectiveExamples - directiveExamples")) +} + // Groups is the resolver for the groups field. func (r *queryResolver) Groups(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) { return r.client.Group.Query(). diff --git a/entgql/internal/todouuid/generated.go b/entgql/internal/todouuid/generated.go index e4dce2f05..3646a9400 100644 --- a/entgql/internal/todouuid/generated.go +++ b/entgql/internal/todouuid/generated.go @@ -65,6 +65,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { + FieldDirective func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error) HasPermissions func(ctx context.Context, obj any, next graphql.Resolver, permissions []string) (res any, err error) } @@ -113,6 +114,15 @@ type ComplexityRoot struct { Info func(childComplexity int) int } + DirectiveExample struct { + ID func(childComplexity int) int + OnAllFields func(childComplexity int) int + OnMutationCreate func(childComplexity int) int + OnMutationFields func(childComplexity int) int + OnMutationUpdate func(childComplexity int) int + OnTypeField func(childComplexity int) int + } + Friendship struct { CreatedAt func(childComplexity int) int Friend func(childComplexity int) int @@ -195,16 +205,17 @@ type ComplexityRoot struct { } Query struct { - BillProducts func(childComplexity int) int - Categories func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int - Groups func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *ent.GroupWhereInput) int - Node func(childComplexity int, id uuid.UUID) int - Nodes func(childComplexity int, ids []uuid.UUID) int - OneToMany func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int - Ping func(childComplexity int) int - Todos func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - TodosWithJoins func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int - Users func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int + BillProducts func(childComplexity int) int + Categories func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.CategoryOrder, where *ent.CategoryWhereInput) int + DirectiveExamples func(childComplexity int) int + Groups func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *ent.GroupWhereInput) int + Node func(childComplexity int, id uuid.UUID) int + Nodes func(childComplexity int, ids []uuid.UUID) int + OneToMany func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) int + Ping func(childComplexity int) int + Todos func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + TodosWithJoins func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) int + Users func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int } Todo struct { @@ -278,6 +289,7 @@ type QueryResolver interface { Nodes(ctx context.Context, ids []uuid.UUID) ([]ent.Noder, error) BillProducts(ctx context.Context) ([]*ent.BillProduct, 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) + DirectiveExamples(ctx context.Context) ([]*DirectiveExample, error) Groups(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *ent.GroupWhereInput) (*ent.GroupConnection, error) OneToMany(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy *OneToManyOrder, where *OneToManyWhereInput) (*OneToManyConnection, error) Todos(ctx context.Context, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, orderBy []*ent.TodoOrder, where *ent.TodoWhereInput) (*ent.TodoConnection, error) @@ -526,6 +538,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Custom.Info(childComplexity), true + case "DirectiveExample.id": + if e.complexity.DirectiveExample.ID == nil { + break + } + + return e.complexity.DirectiveExample.ID(childComplexity), true + + case "DirectiveExample.onAllFields": + if e.complexity.DirectiveExample.OnAllFields == nil { + break + } + + return e.complexity.DirectiveExample.OnAllFields(childComplexity), true + + case "DirectiveExample.onMutationCreate": + if e.complexity.DirectiveExample.OnMutationCreate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationCreate(childComplexity), true + + case "DirectiveExample.onMutationFields": + if e.complexity.DirectiveExample.OnMutationFields == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationFields(childComplexity), true + + case "DirectiveExample.onMutationUpdate": + if e.complexity.DirectiveExample.OnMutationUpdate == nil { + break + } + + return e.complexity.DirectiveExample.OnMutationUpdate(childComplexity), true + + case "DirectiveExample.onTypeField": + if e.complexity.DirectiveExample.OnTypeField == nil { + break + } + + return e.complexity.DirectiveExample.OnTypeField(childComplexity), true + case "Friendship.createdAt": if e.complexity.Friendship.CreatedAt == nil { break @@ -869,6 +923,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Categories(childComplexity, args["after"].(*entgql.Cursor[uuid.UUID]), args["first"].(*int), args["before"].(*entgql.Cursor[uuid.UUID]), args["last"].(*int), args["orderBy"].([]*ent.CategoryOrder), args["where"].(*ent.CategoryWhereInput)), true + case "Query.directiveExamples": + if e.complexity.Query.DirectiveExamples == nil { + break + } + + return e.complexity.Query.DirectiveExamples(childComplexity), true + case "Query.groups": if e.complexity.Query.Groups == nil { break @@ -1218,8 +1279,10 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCategoryTypesInput, ec.unmarshalInputCategoryWhereInput, ec.unmarshalInputCreateCategoryInput, + ec.unmarshalInputCreateDirectiveExampleInput, ec.unmarshalInputCreateTodoInput, ec.unmarshalInputCreateUserInput, + ec.unmarshalInputDirectiveExampleWhereInput, ec.unmarshalInputFriendshipWhereInput, ec.unmarshalInputGroupWhereInput, ec.unmarshalInputOneToManyOrder, @@ -1229,6 +1292,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputTodoOrder, ec.unmarshalInputTodoWhereInput, ec.unmarshalInputUpdateCategoryInput, + ec.unmarshalInputUpdateDirectiveExampleInput, ec.unmarshalInputUpdateFriendshipInput, ec.unmarshalInputUpdateTodoInput, ec.unmarshalInputUpdateUserInput, @@ -1332,6 +1396,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "../todo/todo.graphql", Input: `directive @hasPermissions(permissions: [String!]!) on OBJECT | FIELD_DEFINITION +directive @fieldDirective on FIELD_DEFINITION | INPUT_FIELD_DEFINITION type CategoryConfig { maxMembers: Int @@ -1413,7 +1478,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! -}`, BuiltIn: false}, +} +`, BuiltIn: false}, {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { @@ -1726,6 +1792,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -1758,6 +1835,124 @@ Define a Relay Cursor type: https://relay.dev/graphql/connections.htm#sec-Cursor """ scalar Cursor +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -2252,6 +2447,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -2619,6 +2815,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ @@ -6209,8 +6421,8 @@ func (ec *executionContext) fieldContext_Custom_info(_ context.Context, field gr return fc, nil } -func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_id(ctx, field) +func (ec *executionContext) _DirectiveExample_id(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_id(ctx, field) if err != nil { return graphql.Null } @@ -6240,9 +6452,9 @@ func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.Co return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, IsMethod: false, IsResolver: false, @@ -6253,8 +6465,8 @@ func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field return fc, nil } -func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) +func (ec *executionContext) _DirectiveExample_onTypeField(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onTypeField(ctx, field) if err != nil { return graphql.Null } @@ -6266,39 +6478,58 @@ func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnTypeField, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onTypeField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_userID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) if err != nil { return graphql.Null } @@ -6311,38 +6542,35 @@ func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.UserID, nil + return obj.OnMutationFields, 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friendID(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationCreate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) if err != nil { return graphql.Null } @@ -6355,38 +6583,35 @@ func (ec *executionContext) _Friendship_friendID(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FriendID, nil + return obj.OnMutationCreate, 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationCreate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_user(ctx, field) +func (ec *executionContext) _DirectiveExample_onMutationUpdate(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) if err != nil { return graphql.Null } @@ -6399,56 +6624,35 @@ func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.User(ctx) + return obj.OnMutationUpdate, 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.(*ent.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onMutationUpdate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Friendship_friend(ctx, field) +func (ec *executionContext) _DirectiveExample_onAllFields(ctx context.Context, field graphql.CollectedField, obj *DirectiveExample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DirectiveExample_onAllFields(ctx, field) if err != nil { return graphql.Null } @@ -6460,57 +6664,58 @@ func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Friend(ctx) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OnAllFields, nil + } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) }) 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.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DirectiveExample_onAllFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Friendship", + Object: "DirectiveExample", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) +func (ec *executionContext) _Friendship_id(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_id(ctx, field) if err != nil { return graphql.Null } @@ -6523,41 +6728,38 @@ func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.FriendshipEdge) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendshipEdge(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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_FriendshipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_FriendshipEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) +func (ec *executionContext) _Friendship_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -6570,7 +6772,7 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -6582,36 +6784,26 @@ func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, } return graphql.Null } - res := resTmp.(entgql.PageInfo[uuid.UUID]) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) +func (ec *executionContext) _Friendship_userID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_userID(ctx, field) if err != nil { return graphql.Null } @@ -6624,7 +6816,7 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.UserID, nil }) if err != nil { ec.Error(ctx, err) @@ -6636,26 +6828,26 @@ func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context } return graphql.Null } - res := resTmp.(int) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipConnection", + Object: "Friendship", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) +func (ec *executionContext) _Friendship_friendID(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friendID(ctx, field) if err != nil { return graphql.Null } @@ -6668,49 +6860,38 @@ func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.FriendID, 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.(*ent.Friendship) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friendID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", 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_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) +func (ec *executionContext) _Friendship_user(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_user(ctx, field) if err != nil { return graphql.Null } @@ -6723,7 +6904,7 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.User(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6735,26 +6916,44 @@ func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(entgql.Cursor[uuid.UUID]) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FriendshipEdge", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_id(ctx, field) +func (ec *executionContext) _Friendship_friend(ctx context.Context, field graphql.CollectedField, obj *ent.Friendship) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Friendship_friend(ctx, field) if err != nil { return graphql.Null } @@ -6767,7 +6966,7 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Friend(ctx) }) if err != nil { ec.Error(ctx, err) @@ -6779,26 +6978,44 @@ func (ec *executionContext) _Group_id(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Friendship_friend(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "Friendship", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_name(ctx, field) +func (ec *executionContext) _FriendshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -6811,38 +7028,41 @@ func (ec *executionContext) _Group_name(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Edges, 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) + res := resTmp.([]*ent.FriendshipEdge) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOFriendshipEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendshipEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_FriendshipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FriendshipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Group_users(ctx, field) +func (ec *executionContext) _FriendshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -6855,7 +7075,7 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Users(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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6867,45 +7087,36 @@ func (ec *executionContext) _Group_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Group", + Object: "FriendshipConnection", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) + 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 UserConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", 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_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) +func (ec *executionContext) _FriendshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -6918,41 +7129,38 @@ func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + 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.([]*ent.GroupEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipConnection", 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_GroupEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_GroupEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) +func (ec *executionContext) _FriendshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -6965,48 +7173,49 @@ func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Node, 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]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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) - }, - } + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + }, + } return fc, nil } -func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) +func (ec *executionContext) _FriendshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.FriendshipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FriendshipEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7019,7 +7228,7 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7031,26 +7240,26 @@ func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(int) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FriendshipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupConnection", + Object: "FriendshipEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_node(ctx, field) +func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_id(ctx, field) if err != nil { return graphql.Null } @@ -7062,71 +7271,39 @@ func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - directive0 := func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - } - - directive1 := func(ctx context.Context) (any, error) { - permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) - if err != nil { - var zeroVal *ent.Group - return zeroVal, err - } - if ec.directives.HasPermissions == nil { - var zeroVal *ent.Group - return zeroVal, errors.New("directive hasPermissions is not implemented") - } - return ec.directives.HasPermissions(ctx, obj, directive0, permissions) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*ent.Group); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todouuid/ent.Group`, tmp) + 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.(*ent.Group) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroup(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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_Group_id(ctx, field) - case "name": - return ec.fieldContext_Group_name(ctx, field) - case "users": - return ec.fieldContext_Group_users(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) +func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_name(ctx, field) if err != nil { return graphql.Null } @@ -7139,7 +7316,7 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -7151,26 +7328,26 @@ func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(entgql.Cursor[uuid.UUID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "GroupEdge", + Object: "Group", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) +func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *ent.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_users(ctx, field) if err != nil { return graphql.Null } @@ -7183,7 +7360,7 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) + return obj.Users(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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -7195,43 +7372,27 @@ func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field } return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Group_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Group", Field: field, IsMethod: true, - IsResolver: 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) }, } defer func() { @@ -7241,15 +7402,15 @@ func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Group_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) +func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -7262,83 +7423,41 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) + return obj.Edges, 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.(*ent.Todo) + res := resTmp.([]*ent.GroupEdge) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalOGroupEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + case "node": + return ec.fieldContext_GroupEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupEdge_cursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) +func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -7351,7 +7470,7 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(uuid.UUID), fc.Args["input"].(ent.UpdateTodoInput)) + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -7363,71 +7482,36 @@ func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*ent.Todo) + res := resTmp.(entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) + 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 Todo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) +func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -7440,7 +7524,7 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ClearTodos(rctx) + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -7457,12 +7541,12 @@ func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupConnection", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, @@ -7470,8 +7554,8 @@ func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, return fc, nil } -func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) +func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -7483,64 +7567,71 @@ func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(uuid.UUID), fc.Args["input"].(UpdateFriendshipInput)) + directive0 := func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + } + + directive1 := func(ctx context.Context) (any, error) { + permissions, err := ec.unmarshalNString2ᚕstringᚄ(ctx, []any{"ADMIN", "MODERATOR"}) + if err != nil { + var zeroVal *ent.Group + return zeroVal, err + } + if ec.directives.HasPermissions == nil { + var zeroVal *ent.Group + return zeroVal, errors.New("directive hasPermissions is not implemented") + } + return ec.directives.HasPermissions(ctx, obj, directive0, permissions) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*ent.Group); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *entgo.io/contrib/entgql/internal/todouuid/ent.Group`, tmp) }) 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.Friendship) + res := resTmp.(*ent.Group) fc.Result = res - return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendship(ctx, field.Selections, res) + return ec.marshalOGroup2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "GroupEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Friendship_id(ctx, field) - case "createdAt": - return ec.fieldContext_Friendship_createdAt(ctx, field) - case "userID": - return ec.fieldContext_Friendship_userID(ctx, field) - case "friendID": - return ec.fieldContext_Friendship_friendID(ctx, field) - case "user": - return ec.fieldContext_Friendship_user(ctx, field) - case "friend": - return ec.fieldContext_Friendship_friend(ctx, field) + return ec.fieldContext_Group_id(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_id(ctx, field) +func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -7553,7 +7644,7 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -7565,26 +7656,26 @@ func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "GroupEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_name(ctx, field) +func (ec *executionContext) _Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createCategory(ctx, field) if err != nil { return graphql.Null } @@ -7597,7 +7688,7 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Mutation().CreateCategory(rctx, fc.Args["input"].(ent.CreateCategoryInput)) }) if err != nil { ec.Error(ctx, err) @@ -7609,67 +7700,61 @@ func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createCategory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_field2(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 + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.Field2, nil - }) - if err != nil { + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createCategory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OneToMany", - 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, err } return fc, nil } -func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_parent(ctx, field) +func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) if err != nil { return graphql.Null } @@ -7682,47 +7767,83 @@ func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent, nil + return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(ent.CreateTodoInput)) }) 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.(*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToMany_children(ctx, field) +func (ec *executionContext) _Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTodo(ctx, field) if err != nil { return graphql.Null } @@ -7735,47 +7856,83 @@ func (ec *executionContext) _OneToMany_children(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children, nil + return ec.resolvers.Mutation().UpdateTodo(rctx, fc.Args["id"].(uuid.UUID), fc.Args["input"].(ent.UpdateTodoInput)) }) 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.([]*OneToMany) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyᚄ(ctx, field.Selections, res) + return ec.marshalNTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToMany", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) + return ec.fieldContext_Todo_parent(ctx, field) case "children": - return ec.fieldContext_OneToMany_children(ctx, field) + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) +func (ec *executionContext) _Mutation_clearTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_clearTodos(ctx, field) if err != nil { return graphql.Null } @@ -7788,41 +7945,38 @@ func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return ec.resolvers.Mutation().ClearTodos(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*OneToManyEdge) + res := resTmp.(int) fc.Result = res - return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyEdge(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_clearTodos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_OneToManyEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_OneToManyEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) +func (ec *executionContext) _Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFriendship(ctx, field) if err != nil { return graphql.Null } @@ -7835,7 +7989,7 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Mutation().UpdateFriendship(rctx, fc.Args["id"].(uuid.UUID), fc.Args["input"].(UpdateFriendshipInput)) }) if err != nil { ec.Error(ctx, err) @@ -7847,36 +8001,51 @@ func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, f } return graphql.Null } - res := resTmp.(*entgql.PageInfo[uuid.UUID]) + res := resTmp.(*ent.Friendship) fc.Result = res - return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNFriendship2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendship(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateFriendship(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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) + case "id": + return ec.fieldContext_Friendship_id(ctx, field) + case "createdAt": + return ec.fieldContext_Friendship_createdAt(ctx, field) + case "userID": + return ec.fieldContext_Friendship_userID(ctx, field) + case "friendID": + return ec.fieldContext_Friendship_friendID(ctx, field) + case "user": + return ec.fieldContext_Friendship_user(ctx, field) + case "friend": + return ec.fieldContext_Friendship_friend(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Friendship", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFriendship_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) +func (ec *executionContext) _OneToMany_id(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_id(ctx, field) if err != nil { return graphql.Null } @@ -7889,7 +8058,7 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7901,26 +8070,26 @@ func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyConnection", + Object: "OneToMany", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) +func (ec *executionContext) _OneToMany_name(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_name(ctx, field) if err != nil { return graphql.Null } @@ -7933,47 +8102,38 @@ func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*OneToMany) + res := resTmp.(string) fc.Result = res - return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToMany(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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_OneToMany_id(ctx, field) - case "name": - return ec.fieldContext_OneToMany_name(ctx, field) - case "field2": - return ec.fieldContext_OneToMany_field2(ctx, field) - case "parent": - return ec.fieldContext_OneToMany_parent(ctx, field) - case "children": - return ec.fieldContext_OneToMany_children(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) +func (ec *executionContext) _OneToMany_field2(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_field2(ctx, field) if err != nil { return graphql.Null } @@ -7986,38 +8146,35 @@ func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Field2, 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]) + res := resTmp.(*string) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_field2(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "OneToManyEdge", + Object: "OneToMany", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_id(ctx, field) +func (ec *executionContext) _OneToMany_parent(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_parent(ctx, field) if err != nil { return graphql.Null } @@ -8030,38 +8187,47 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Organization().ID(rctx, obj) + return obj.Parent, 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) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", Field: field, - IsMethod: true, - IsResolver: true, + 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Organization_name(ctx, field) +func (ec *executionContext) _OneToMany_children(ctx context.Context, field graphql.CollectedField, obj *OneToMany) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToMany_children(ctx, field) if err != nil { return graphql.Null } @@ -8074,38 +8240,47 @@ func (ec *executionContext) _Organization_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Children, 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) + res := resTmp.([]*OneToMany) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToMany_children(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Organization", + Object: "OneToMany", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } 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) +func (ec *executionContext) _OneToManyConnection_edges(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -8118,38 +8293,41 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasNextPage, nil + return obj.Edges, 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) + res := resTmp.([]*OneToManyEdge) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOOneToManyEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + switch field.Name { + case "node": + return ec.fieldContext_OneToManyEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OneToManyEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyEdge", field.Name) }, } 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) +func (ec *executionContext) _OneToManyConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -8162,7 +8340,7 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.HasPreviousPage, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -8174,26 +8352,36 @@ func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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") + 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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[uuid.UUID]) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _OneToManyConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *OneToManyConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -8206,35 +8394,38 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.StartCursor, nil + 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.(*entgql.Cursor[uuid.UUID]) + res := resTmp.(int) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyConnection", 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 nil, errors.New("field of type Int 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) +func (ec *executionContext) _OneToManyEdge_node(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -8247,7 +8438,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EndCursor, nil + return obj.Node, nil }) if err != nil { ec.Error(ctx, err) @@ -8256,26 +8447,38 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*entgql.Cursor[uuid.UUID]) + res := resTmp.(*OneToMany) fc.Result = res - return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalOOneToMany2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToMany(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PageInfo", + Object: "OneToManyEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_OneToMany_id(ctx, field) + case "name": + return ec.fieldContext_OneToMany_name(ctx, field) + case "field2": + return ec.fieldContext_OneToMany_field2(ctx, field) + case "parent": + return ec.fieldContext_OneToMany_parent(ctx, field) + case "children": + return ec.fieldContext_OneToMany_children(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToMany", field.Name) }, } return fc, nil } -func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_id(ctx, field) +func (ec *executionContext) _OneToManyEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *OneToManyEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OneToManyEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -8288,7 +8491,7 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -8300,26 +8503,26 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_OneToManyEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "OneToManyEdge", 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_todos(ctx, field) +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_id(ctx, field) if err != nil { return graphql.Null } @@ -8332,7 +8535,7 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Todos, nil + return ec.resolvers.Organization().ID(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8344,45 +8547,26 @@ func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Organization", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } 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) +func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *ent1.Workspace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_name(ctx, field) if err != nil { return graphql.Null } @@ -8395,50 +8579,42 @@ func (ec *executionContext) _Query_node(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Node(rctx, fc.Args["id"].(uuid.UUID)) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(ent.Noder) + res := resTmp.(string) fc.Result = res - return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Organization", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_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) + 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)) @@ -8447,7 +8623,7 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]uuid.UUID)) + return obj.HasNextPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8459,37 +8635,26 @@ func (ec *executionContext) _Query_nodes(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]ent.Noder) + res := resTmp.(bool) fc.Result = res - return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐNoder(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_billProducts(ctx, field) +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 } @@ -8502,7 +8667,7 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().BillProducts(rctx) + return obj.HasPreviousPage, nil }) if err != nil { ec.Error(ctx, err) @@ -8514,36 +8679,26 @@ func (ec *executionContext) _Query_billProducts(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*ent.BillProduct) + res := resTmp.(bool) fc.Result = res - return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_BillProduct_id(ctx, field) - case "name": - return ec.fieldContext_BillProduct_name(ctx, field) - case "sku": - return ec.fieldContext_BillProduct_sku(ctx, field) - case "quantity": - return ec.fieldContext_BillProduct_quantity(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type BillProduct", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } 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) +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 } @@ -8556,57 +8711,35 @@ func (ec *executionContext) _Query_categories(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, 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)) + return obj.StartCursor, 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.(*ent.CategoryConnection) + res := resTmp.(*entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, 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) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_categories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_groups(ctx, field) +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 } @@ -8619,57 +8752,35 @@ func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Groups(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["where"].(*ent.GroupWhereInput)) + return obj.EndCursor, 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.(*ent.GroupConnection) + res := resTmp.(*entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_oneToMany(ctx, field) +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_id(ctx, field) if err != nil { return graphql.Null } @@ -8682,7 +8793,7 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().OneToMany(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"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8694,45 +8805,26 @@ func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*OneToManyConnection) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyConnection(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_OneToManyConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todos(ctx, field) +func (ec *executionContext) _Project_todos(ctx context.Context, field graphql.CollectedField, obj *Project) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Project_todos(ctx, field) if err != nil { return graphql.Null } @@ -8745,7 +8837,7 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Todos(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.Todos, nil }) if err != nil { ec.Error(ctx, err) @@ -8762,12 +8854,12 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Project_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Project", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": @@ -8787,15 +8879,15 @@ func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Project_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_users(ctx, field) +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 } @@ -8808,39 +8900,28 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Users(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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(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.UserConnection) + res := resTmp.(ent.Noder) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalONode2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") }, } defer func() { @@ -8850,15 +8931,15 @@ func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ping(ctx, field) +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 } @@ -8871,7 +8952,7 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ping(rctx) + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]uuid.UUID)) }) if err != nil { ec.Error(ctx, err) @@ -8883,26 +8964,37 @@ func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]ent.Noder) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNNode2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐNoder(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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("field of type String does not have child fields") + 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_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) +func (ec *executionContext) _Query_billProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_billProducts(ctx, field) if err != nil { return graphql.Null } @@ -8915,7 +9007,7 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TodosWithJoins(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return ec.resolvers.Query().BillProducts(rctx) }) if err != nil { ec.Error(ctx, err) @@ -8927,12 +9019,12 @@ func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*ent.TodoConnection) + res := resTmp.([]*ent.BillProduct) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalNBillProduct2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_billProducts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -8940,32 +9032,23 @@ func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_BillProduct_id(ctx, field) + case "name": + return ec.fieldContext_BillProduct_name(ctx, field) + case "sku": + return ec.fieldContext_BillProduct_sku(ctx, field) + case "quantity": + return ec.fieldContext_BillProduct_quantity(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type BillProduct", 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_todosWithJoins_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) +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 } @@ -8978,50 +9061,39 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + 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.(*introspection.Type) + res := resTmp.(*ent.CategoryConnection) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNCategoryConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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: false, + IsResolver: true, 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) + 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 __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CategoryConnection", field.Name) }, } defer func() { @@ -9031,15 +9103,15 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _Query_directiveExamples(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_directiveExamples(ctx, field) if err != nil { return graphql.Null } @@ -9052,49 +9124,52 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return ec.resolvers.Query().DirectiveExamples(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]*DirectiveExample) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_directiveExamples(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, 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) + case "id": + return ec.fieldContext_DirectiveExample_id(ctx, field) + case "onTypeField": + return ec.fieldContext_DirectiveExample_onTypeField(ctx, field) + case "onMutationFields": + return ec.fieldContext_DirectiveExample_onMutationFields(ctx, field) + case "onMutationCreate": + return ec.fieldContext_DirectiveExample_onMutationCreate(ctx, field) + case "onMutationUpdate": + return ec.fieldContext_DirectiveExample_onMutationUpdate(ctx, field) + case "onAllFields": + return ec.fieldContext_DirectiveExample_onAllFields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DirectiveExample", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_id(ctx, field) +func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groups(ctx, field) if err != nil { return graphql.Null } @@ -9107,7 +9182,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().Groups(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["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9119,26 +9194,45 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_createdAt(ctx, field) +func (ec *executionContext) _Query_oneToMany(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oneToMany(ctx, field) if err != nil { return graphql.Null } @@ -9151,7 +9245,7 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, nil + return ec.resolvers.Query().OneToMany(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"].(*OneToManyOrder), fc.Args["where"].(*OneToManyWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9163,26 +9257,45 @@ func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*OneToManyConnection) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNOneToManyConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐOneToManyConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_oneToMany(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_OneToManyConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OneToManyConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OneToManyConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OneToManyConnection", 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_oneToMany_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_status(ctx, field) +func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todos(ctx, field) if err != nil { return graphql.Null } @@ -9195,7 +9308,7 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().Status(rctx, obj) + return ec.resolvers.Query().Todos(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9207,26 +9320,45 @@ func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(todo.Status) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TodoStatus does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todos_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) +func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_users(ctx, field) if err != nil { return graphql.Null } @@ -9239,7 +9371,7 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Priority, nil + return ec.resolvers.Query().Users(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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -9251,26 +9383,45 @@ func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err } return fc, nil } -func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_text(ctx, field) +func (ec *executionContext) _Query_ping(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ping(ctx, field) if err != nil { return graphql.Null } @@ -9283,7 +9434,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Text, nil + return ec.resolvers.Query().Ping(rctx) }) if err != nil { ec.Error(ctx, err) @@ -9300,12 +9451,12 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ping(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -9313,8 +9464,8 @@ func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryID(ctx, field) +func (ec *executionContext) _Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_todosWithJoins(ctx, field) if err != nil { return graphql.Null } @@ -9327,35 +9478,57 @@ func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.resolvers.Query().TodosWithJoins(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) 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) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_todosWithJoins(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", 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_todosWithJoins_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category_id(ctx, field) +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 } @@ -9368,7 +9541,7 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -9377,26 +9550,59 @@ func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + 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) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_categoryX(ctx, field) +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 } @@ -9409,7 +9615,7 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CategoryID, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) @@ -9418,26 +9624,40 @@ func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Todo", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_init(ctx, field) +func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_id(ctx, field) if err != nil { return graphql.Null } @@ -9450,35 +9670,38 @@ func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Init, nil + 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.(map[string]interface{}) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_custom(ctx, field) +func (ec *executionContext) _Todo_createdAt(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -9491,39 +9714,38 @@ func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Custom, nil + 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.([]customstruct.Custom) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_customp(ctx, field) +func (ec *executionContext) _Todo_status(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_status(ctx, field) if err != nil { return graphql.Null } @@ -9536,39 +9758,38 @@ func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Customp, nil + return ec.resolvers.Todo().Status(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*customstruct.Custom) + res := resTmp.(todo.Status) fc.Result = res - return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) + return ec.marshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "info": - return ec.fieldContext_Custom_info(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) + return nil, errors.New("field of type TodoStatus does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_value(ctx, field) +func (ec *executionContext) _Todo_priorityOrder(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_priorityOrder(ctx, field) if err != nil { return graphql.Null } @@ -9581,7 +9802,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Value, nil + return obj.Priority, nil }) if err != nil { ec.Error(ctx, err) @@ -9598,7 +9819,7 @@ func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_priorityOrder(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, @@ -9611,8 +9832,8 @@ func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field gra return fc, nil } -func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_parent(ctx, field) +func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_text(ctx, field) if err != nil { return graphql.Null } @@ -9625,69 +9846,38 @@ func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Parent(ctx) + return obj.Text, 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.(*ent.Todo) + res := resTmp.(string) fc.Result = res - return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Todo_id(ctx, field) - case "createdAt": - return ec.fieldContext_Todo_createdAt(ctx, field) - case "status": - return ec.fieldContext_Todo_status(ctx, field) - case "priorityOrder": - return ec.fieldContext_Todo_priorityOrder(ctx, field) - case "text": - return ec.fieldContext_Todo_text(ctx, field) - case "categoryID": - return ec.fieldContext_Todo_categoryID(ctx, field) - case "category_id": - return ec.fieldContext_Todo_category_id(ctx, field) - case "categoryX": - return ec.fieldContext_Todo_categoryX(ctx, field) - case "init": - return ec.fieldContext_Todo_init(ctx, field) - case "custom": - return ec.fieldContext_Todo_custom(ctx, field) - case "customp": - return ec.fieldContext_Todo_customp(ctx, field) - case "value": - return ec.fieldContext_Todo_value(ctx, field) - case "parent": - return ec.fieldContext_Todo_parent(ctx, field) - case "children": - return ec.fieldContext_Todo_children(ctx, field) - case "category": - return ec.fieldContext_Todo_category(ctx, field) - case "extendedField": - return ec.fieldContext_Todo_extendedField(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_children(ctx, field) +func (ec *executionContext) _Todo_categoryID(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryID(ctx, field) if err != nil { return graphql.Null } @@ -9700,57 +9890,76 @@ func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Children(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) + return obj.CategoryID, 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.(*ent.TodoConnection) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) + return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_TodoConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_TodoConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_TodoConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Todo_category_id(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CategoryID, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Todo_category_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Todo", + 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) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_category(ctx, field) +func (ec *executionContext) _Todo_categoryX(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_categoryX(ctx, field) if err != nil { return graphql.Null } @@ -9763,7 +9972,7 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Category(ctx) + return obj.CategoryID, nil }) if err != nil { ec.Error(ctx, err) @@ -9772,50 +9981,26 @@ func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.Category) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategory(ctx, field.Selections, res) + return ec.marshalOID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_categoryX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, + 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 "text": - return ec.fieldContext_Category_text(ctx, field) - case "status": - return ec.fieldContext_Category_status(ctx, field) - case "config": - return ec.fieldContext_Category_config(ctx, field) - case "types": - return ec.fieldContext_Category_types(ctx, field) - case "duration": - return ec.fieldContext_Category_duration(ctx, field) - case "count": - return ec.fieldContext_Category_count(ctx, field) - case "strings": - return ec.fieldContext_Category_strings(ctx, field) - case "todos": - return ec.fieldContext_Category_todos(ctx, field) - case "subCategories": - return ec.fieldContext_Category_subCategories(ctx, field) - case "todosCount": - return ec.fieldContext_Category_todosCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Todo_extendedField(ctx, field) +func (ec *executionContext) _Todo_init(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_init(ctx, field) if err != nil { return graphql.Null } @@ -9828,7 +10013,7 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Todo().ExtendedField(rctx, obj) + return obj.Init, nil }) if err != nil { ec.Error(ctx, err) @@ -9837,26 +10022,26 @@ func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_init(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Todo", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) +func (ec *executionContext) _Todo_custom(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_custom(ctx, field) if err != nil { return graphql.Null } @@ -9869,7 +10054,7 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Custom, nil }) if err != nil { ec.Error(ctx, err) @@ -9878,32 +10063,30 @@ func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*ent.TodoEdge) + res := resTmp.([]customstruct.Custom) fc.Result = res - return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoEdge(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_custom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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_TodoEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_TodoEdge_cursor(ctx, field) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) +func (ec *executionContext) _Todo_customp(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_customp(ctx, field) if err != nil { return graphql.Null } @@ -9916,48 +10099,39 @@ func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return obj.Customp, 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]) + res := resTmp.([]*customstruct.Custom) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOCustom2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋcustomstructᚐCustom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_customp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", 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) + case "info": + return ec.fieldContext_Custom_info(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Custom", field.Name) }, } return fc, nil } -func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) +func (ec *executionContext) _Todo_value(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_value(ctx, field) if err != nil { return graphql.Null } @@ -9970,7 +10144,7 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -9987,9 +10161,9 @@ func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoConnection", + Object: "Todo", Field: field, IsMethod: false, IsResolver: false, @@ -10000,8 +10174,8 @@ func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Con return fc, nil } -func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_node(ctx, field) +func (ec *executionContext) _Todo_parent(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_parent(ctx, field) if err != nil { return graphql.Null } @@ -10014,7 +10188,7 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Parent(ctx) }) if err != nil { ec.Error(ctx, err) @@ -10028,11 +10202,11 @@ func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.Co return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -10075,8 +10249,8 @@ func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field return fc, nil } -func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) +func (ec *executionContext) _Todo_children(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_children(ctx, field) if err != nil { return graphql.Null } @@ -10089,7 +10263,7 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Children(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.TodoOrder), fc.Args["where"].(*ent.TodoWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10101,26 +10275,45 @@ func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[uuid.UUID]) + res := resTmp.(*ent.TodoConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNTodoConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TodoEdge", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_TodoConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TodoConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TodoConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_id(ctx, field) + 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_Todo_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Todo_category(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_category(ctx, field) if err != nil { return graphql.Null } @@ -10133,38 +10326,59 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Category(ctx) }) 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) + res := resTmp.(*ent.Category) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOCategory2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "id": + return ec.fieldContext_Category_id(ctx, field) + case "text": + return ec.fieldContext_Category_text(ctx, field) + case "status": + return ec.fieldContext_Category_status(ctx, field) + case "config": + return ec.fieldContext_Category_config(ctx, field) + case "types": + return ec.fieldContext_Category_types(ctx, field) + case "duration": + return ec.fieldContext_Category_duration(ctx, field) + case "count": + return ec.fieldContext_Category_count(ctx, field) + case "strings": + return ec.fieldContext_Category_strings(ctx, field) + case "todos": + return ec.fieldContext_Category_todos(ctx, field) + case "subCategories": + return ec.fieldContext_Category_subCategories(ctx, field) + case "todosCount": + return ec.fieldContext_Category_todosCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Category", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_name(ctx, field) +func (ec *executionContext) _Todo_extendedField(ctx context.Context, field graphql.CollectedField, obj *ent.Todo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Todo_extendedField(ctx, field) if err != nil { return graphql.Null } @@ -10177,29 +10391,26 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Todo().ExtendedField(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Todo_extendedField(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "Todo", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -10207,8 +10418,8 @@ func (ec *executionContext) fieldContext_User_name(_ context.Context, field grap return fc, nil } -func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_username(ctx, field) +func (ec *executionContext) _TodoConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10221,38 +10432,41 @@ func (ec *executionContext) _User_username(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Username(rctx, obj) + return obj.Edges, 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) + res := resTmp.([]*ent.TodoEdge) fc.Result = res - return ec.marshalNUUID2string(ctx, field.Selections, res) + return ec.marshalOTodoEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_TodoEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TodoEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TodoEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) +func (ec *executionContext) _TodoConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10265,7 +10479,7 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.RequiredMetadata, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10277,26 +10491,36 @@ func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalNMap2map(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + 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) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_metadata(ctx, field) +func (ec *executionContext) _TodoConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.TodoConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10309,35 +10533,38 @@ func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Metadata, nil + 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.(map[string]interface{}) + res := resTmp.(int) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_groups(ctx, field) +func (ec *executionContext) _TodoEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -10350,57 +10577,69 @@ func (ec *executionContext) _User_groups(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Groups(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["where"].(*ent.GroupWhereInput)) + return obj.Node, 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.(*ent.GroupConnection) + res := resTmp.(*ent.Todo) fc.Result = res - return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupConnection(ctx, field.Selections, res) + return ec.marshalOTodo2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_GroupConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_GroupConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_GroupConnection_totalCount(ctx, field) + case "id": + return ec.fieldContext_Todo_id(ctx, field) + case "createdAt": + return ec.fieldContext_Todo_createdAt(ctx, field) + case "status": + return ec.fieldContext_Todo_status(ctx, field) + case "priorityOrder": + return ec.fieldContext_Todo_priorityOrder(ctx, field) + case "text": + return ec.fieldContext_Todo_text(ctx, field) + case "categoryID": + return ec.fieldContext_Todo_categoryID(ctx, field) + case "category_id": + return ec.fieldContext_Todo_category_id(ctx, field) + case "categoryX": + return ec.fieldContext_Todo_categoryX(ctx, field) + case "init": + return ec.fieldContext_Todo_init(ctx, field) + case "custom": + return ec.fieldContext_Todo_custom(ctx, field) + case "customp": + return ec.fieldContext_Todo_customp(ctx, field) + case "value": + return ec.fieldContext_Todo_value(ctx, field) + case "parent": + return ec.fieldContext_Todo_parent(ctx, field) + case "children": + return ec.fieldContext_Todo_children(ctx, field) + case "category": + return ec.fieldContext_Todo_category(ctx, field) + case "extendedField": + return ec.fieldContext_Todo_extendedField(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type GroupConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Todo", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friends(ctx, field) +func (ec *executionContext) _TodoEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.TodoEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TodoEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -10413,7 +10652,7 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friends(rctx, obj, 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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) + return obj.Cursor, nil }) if err != nil { ec.Error(ctx, err) @@ -10425,45 +10664,26 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*ent.UserConnection) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TodoEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "User", + Object: "TodoEdge", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_UserConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_UserConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_UserConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserConnection", field.Name) + return nil, errors.New("field of type Cursor does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_friendships(ctx, field) +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) if err != nil { return graphql.Null } @@ -10476,7 +10696,7 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -10488,45 +10708,26 @@ func (ec *executionContext) _User_friendships(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*ent.FriendshipConnection) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendshipConnection(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "User", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_FriendshipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_edges(ctx, field) +func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_name(ctx, field) if err != nil { return graphql.Null } @@ -10539,41 +10740,38 @@ func (ec *executionContext) _UserConnection_edges(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*ent.UserEdge) + res := resTmp.(string) fc.Result = res - return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserEdge(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", 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_UserEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_UserEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) +func (ec *executionContext) _User_username(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_username(ctx, field) if err != nil { return graphql.Null } @@ -10586,7 +10784,7 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.User().Username(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -10598,36 +10796,26 @@ func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field } return graphql.Null } - res := resTmp.(entgql.PageInfo[uuid.UUID]) + res := resTmp.(string) fc.Result = res - return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) + return ec.marshalNUUID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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 nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) +func (ec *executionContext) _User_requiredMetadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_requiredMetadata(ctx, field) if err != nil { return graphql.Null } @@ -10640,7 +10828,7 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.RequiredMetadata, nil }) if err != nil { ec.Error(ctx, err) @@ -10652,26 +10840,26 @@ func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(int) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_requiredMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserConnection", + Object: "User", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_node(ctx, field) +func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(ctx, field) if err != nil { return graphql.Null } @@ -10684,7 +10872,7 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Node, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -10693,44 +10881,26 @@ func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*ent.User) + res := resTmp.(map[string]interface{}) fc.Result = res - return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) + return ec.marshalOMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", 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_User_id(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "username": - return ec.fieldContext_User_username(ctx, field) - case "requiredMetadata": - return ec.fieldContext_User_requiredMetadata(ctx, field) - case "metadata": - return ec.fieldContext_User_metadata(ctx, field) - case "groups": - return ec.fieldContext_User_groups(ctx, field) - case "friends": - return ec.fieldContext_User_friends(ctx, field) - case "friendships": - return ec.fieldContext_User_friendships(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) +func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groups(ctx, field) if err != nil { return graphql.Null } @@ -10743,7 +10913,7 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Cursor, nil + return obj.Groups(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["where"].(*ent.GroupWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10755,26 +10925,45 @@ func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(entgql.Cursor[uuid.UUID]) + res := resTmp.(*ent.GroupConnection) fc.Result = res - return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) + return ec.marshalNGroupConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐGroupConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UserEdge", + Object: "User", Field: field, - IsMethod: false, + IsMethod: true, 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") + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_User_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friends(ctx, field) if err != nil { return graphql.Null } @@ -10787,7 +10976,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.User().Friends(rctx, obj, 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.UserOrder), fc.Args["where"].(*ent.UserWhereInput)) }) if err != nil { ec.Error(ctx, err) @@ -10799,26 +10988,45 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*ent.UserConnection) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNUserConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friends(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_User_friends_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _User_friendships(ctx context.Context, field graphql.CollectedField, obj *ent.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_friendships(ctx, field) if err != nil { return graphql.Null } @@ -10831,35 +11039,57 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return ec.resolvers.User().Friendships(rctx, obj, fc.Args["after"].(*entgql.Cursor[uuid.UUID]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[uuid.UUID]), fc.Args["last"].(*int), fc.Args["where"].(*ent.FriendshipWhereInput)) }) 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) + res := resTmp.(*ent.FriendshipConnection) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNFriendshipConnection2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐFriendshipConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_User_friendships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "User", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "edges": + return ec.fieldContext_FriendshipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FriendshipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FriendshipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FriendshipConnection", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) + 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_User_friendships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_edges(ctx, field) if err != nil { return graphql.Null } @@ -10872,38 +11102,41 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Edges, 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) + res := resTmp.([]*ent.UserEdge) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOUserEdge2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUserEdge(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "node": + return ec.fieldContext_UserEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -10916,7 +11149,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -10928,36 +11161,36 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(entgql.PageInfo[uuid.UUID]) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + case "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 __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *ent.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -10970,7 +11203,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -10982,26 +11215,26 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UserConnection", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -11014,38 +11247,53 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Node, 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) + res := resTmp.(*ent.User) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOUser2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "username": + return ec.fieldContext_User_username(ctx, field) + case "requiredMetadata": + return ec.fieldContext_User_requiredMetadata(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "friends": + return ec.fieldContext_User_friends(ctx, field) + case "friendships": + return ec.fieldContext_User_friendships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *ent.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -11058,35 +11306,38 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + 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.(*string) + res := resTmp.(entgql.Cursor[uuid.UUID]) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "UserEdge", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type Cursor does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -11099,7 +11350,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11111,26 +11362,26 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, - IsMethod: true, + 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) if err != nil { return graphql.Null } @@ -11143,7 +11394,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -11157,9 +11408,9 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "__Directive", Field: field, IsMethod: true, IsResolver: false, @@ -11170,8 +11421,8 @@ func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) if err != nil { return graphql.Null } @@ -11184,7 +11435,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) @@ -11196,26 +11447,26 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type __DirectiveLocation does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) if err != nil { return graphql.Null } @@ -11228,35 +11479,48 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, - IsMethod: true, + 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") + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) if err != nil { return graphql.Null } @@ -11269,7 +11533,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) @@ -11281,36 +11545,26 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11323,7 +11577,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11335,48 +11589,67 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11406,9 +11679,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11419,8 +11692,8 @@ func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11447,9 +11720,9 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "__EnumValue", Field: field, IsMethod: true, IsResolver: false, @@ -11460,8 +11733,8 @@ func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Con return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) if err != nil { return graphql.Null } @@ -11491,9 +11764,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, @@ -11504,8 +11777,8 @@ func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) if err != nil { return graphql.Null } @@ -11532,9 +11805,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, @@ -11545,8 +11818,62 @@ func (ec *executionContext) fieldContext___InputValue_description(_ context.Cont return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) if err != nil { return graphql.Null } @@ -11576,9 +11903,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, IsMethod: false, IsResolver: false, @@ -11611,8 +11938,8 @@ func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, fi return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) if err != nil { return graphql.Null } @@ -11625,35 +11952,38 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.IsDeprecated(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(bool) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "__Field", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) if err != nil { return graphql.Null } @@ -11666,7 +11996,7 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.DeprecationReason(), nil }) if err != nil { ec.Error(ctx, err) @@ -11680,9 +12010,9 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__Field", Field: field, IsMethod: true, IsResolver: false, @@ -11693,8 +12023,8 @@ func (ec *executionContext) fieldContext___Schema_description(_ context.Context, return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) if err != nil { return graphql.Null } @@ -11707,7 +12037,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -11719,48 +12049,26 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) if err != nil { return graphql.Null } @@ -11773,60 +12081,35 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", 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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) if err != nil { return graphql.Null } @@ -11839,25 +12122,28 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { @@ -11888,8 +12174,8 @@ func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) if err != nil { return graphql.Null } @@ -11902,7 +12188,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.DefaultValue, nil }) if err != nil { ec.Error(ctx, err) @@ -11911,48 +12197,26 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "__InputValue", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "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) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) if err != nil { return graphql.Null } @@ -11965,50 +12229,35 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) if err != nil { return graphql.Null } @@ -12021,7 +12270,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Types(), nil }) if err != nil { ec.Error(ctx, err) @@ -12033,26 +12282,48 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) if err != nil { return graphql.Null } @@ -12065,35 +12336,60 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.QueryType(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) if err != nil { return graphql.Null } @@ -12106,7 +12402,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.MutationType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12115,26 +12411,48 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + 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) }, } return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) if err != nil { return graphql.Null } @@ -12147,7 +12465,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.SubscriptionType(), nil }) if err != nil { ec.Error(ctx, err) @@ -12156,51 +12474,48 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Field_name(ctx, field) + return ec.fieldContext___Type_name(ctx, field) case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + return 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) + }, } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) if err != nil { return graphql.Null } @@ -12213,57 +12528,50 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.Directives(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]introspection.Directive) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "__Schema", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Type_name(ctx, field) + return ec.fieldContext___Directive_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 ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) if err != nil { return graphql.Null } @@ -12276,57 +12584,38 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.Kind(), nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - 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) + return nil, errors.New("field of type __TypeKind does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) if err != nil { return graphql.Null } @@ -12339,7 +12628,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.Name(), nil }) if err != nil { ec.Error(ctx, err) @@ -12348,47 +12637,67 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) if err != nil { return graphql.Null } @@ -12401,7 +12710,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -12410,12 +12719,12 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.([]introspection.Field) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12424,22 +12733,37 @@ func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, f Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": - return ec.fieldContext___InputValue_name(ctx, field) + return ec.fieldContext___Field_name(ctx, field) case "description": - return ec.fieldContext___InputValue_description(ctx, field) + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) if err != nil { return graphql.Null } @@ -12452,7 +12776,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Interfaces(), nil }) if err != nil { ec.Error(ctx, err) @@ -12461,12 +12785,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -12501,8 +12825,8 @@ func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) if err != nil { return graphql.Null } @@ -12515,7 +12839,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.PossibleTypes(), nil }) if err != nil { ec.Error(ctx, err) @@ -12524,463 +12848,1512 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]introspection.Type) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { - var it ent.BillProductWhereInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] + 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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "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) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputBillProductWhereInput(ctx context.Context, obj any) (ent.BillProductWhereInput, error) { + var it ent.BillProductWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "sku", "skuNEQ", "skuIn", "skuNotIn", "skuGT", "skuGTE", "skuLT", "skuLTE", "skuContains", "skuHasPrefix", "skuHasSuffix", "skuEqualFold", "skuContainsFold", "quantity", "quantityNEQ", "quantityIn", "quantityNotIn", "quantityGT", "quantityGTE", "quantityLT", "quantityLTE"} + 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.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInputᚄ(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 "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 "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 "sku": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sku = data + case "skuNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuNEQ = data + case "skuIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuIn = data + case "skuNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SkuNotIn = data + case "skuGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGT = data + case "skuGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuGTE = data + case "skuLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLT = data + case "skuLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuLTE = data + case "skuContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContains = data + case "skuHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasPrefix = data + case "skuHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuHasSuffix = data + case "skuEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuEqualFold = data + case "skuContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SkuContainsFold = data + case "quantity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.Quantity = data + case "quantityNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityNEQ = data + case "quantityIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityIn = data + case "quantityNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.QuantityNotIn = data + case "quantityGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGT = data + case "quantityGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityGTE = data + case "quantityLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLT = data + case "quantityLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.QuantityLTE = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { + var it schematype.CategoryConfig + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"maxMembers"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "maxMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) + data, err := ec.unmarshalOInt2int(ctx, v) + if err != nil { + return it, err + } + it.MaxMembers = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { + var it ent.CategoryOrder + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + 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ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (CategoryTypesInput, error) { + var it CategoryTypesInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"public"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "public": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Public = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { + var it ent.CategoryWhereInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} + 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.unmarshalOBillProductWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInput(ctx, v) + data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋ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ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋ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 "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "textNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextNEQ = data + case "textIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextIn = data + case "textNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextNotIn = data + case "textGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGT = data + case "textGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGTE = data + case "textLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLT = data + case "textLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLTE = data + case "textContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContains = data + case "textHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasPrefix = data + case "textHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Not = data - case "and": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.TextHasSuffix = data + case "textEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.And = data - case "or": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOBillProductWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐBillProductWhereInputᚄ(ctx, v) + it.TextEqualFold = data + case "textContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(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) + it.TextContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(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) + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(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) + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatusᚄ(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) + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatusᚄ(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) + it.StatusNotIn = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.Config = data + case "configNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigNEQ = data + case "configIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(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) + it.ConfigIn = data + case "configNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) + data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) if err != nil { return it, err } - it.IDLTE = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.ConfigNotIn = data + case "configGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigGT = data + case "configGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigGTE = data + case "configLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigLT = data + case "configLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(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) + it.ConfigLTE = data + case "configIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigIsNil = data + case "configNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) + data, err := ec.unmarshalOBoolean2bool(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) + it.ConfigNotNil = data + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.Duration = data + case "durationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationNEQ = data + case "durationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationIn = data + case "durationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) + data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(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) + it.DurationNotIn = data + case "durationGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.NameHasSuffix = data - case "nameEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationGT = data + case "durationGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(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) + it.DurationGTE = data + case "durationLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.NameContainsFold = data - case "sku": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sku")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationLT = data + case "durationLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.Sku = data - case "skuNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.DurationLTE = data + case "durationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuNEQ = data - case "skuIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.DurationIsNil = data + case "durationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DurationNotNil = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.Count = data + case "countNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountNEQ = data + case "countIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountIn = data + case "countNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) + data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + it.CountNotIn = data + case "countGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGT = data + case "countGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + if err != nil { + return it, err + } + it.CountGTE = data + case "countLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.SkuIn = data - case "skuNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.CountLT = data + case "countLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.SkuNotIn = data - case "skuGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountLTE = data + case "countIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuGT = data - case "skuGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountIsNil = data + case "countNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) if err != nil { return it, err } - it.SkuGTE = data - case "skuLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.CountNotNil = data + case "hasTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuLT = data - case "skuLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasTodos = data + case "hasTodosWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) + data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuLTE = data - case "skuContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasTodosWith = data + case "hasSubCategories": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.SkuContains = data - case "skuHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategories = data + case "hasSubCategoriesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) + data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryWhereInputᚄ(ctx, v) if err != nil { return it, err } - it.SkuHasPrefix = data - case "skuHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.HasSubCategoriesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { + var it ent.CreateCategoryInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } - it.SkuHasSuffix = data - case "skuEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Text = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(ctx, v) if err != nil { return it, err } - it.SkuEqualFold = data - case "skuContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("skuContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Status = data + case "config": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) + data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) if err != nil { return it, err } - it.SkuContainsFold = data - case "quantity": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantity")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Config = data + case "types": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) + data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐCategoryTypesInput(ctx, v) if err != nil { return it, err } - it.Quantity = data - case "quantityNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) - if err != nil { + if err = ec.resolvers.CreateCategoryInput().Types(ctx, &it, data); err != nil { return it, err } - it.QuantityNEQ = data - case "quantityIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + case "duration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) if err != nil { return it, err } - it.QuantityIn = data - case "quantityNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.Duration = data + case "count": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) + data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) if err != nil { return it, err } - it.QuantityNotIn = data - case "quantityGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Count = data + case "strings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.QuantityGT = data - case "quantityGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.Strings = data + case "todoIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) if err != nil { return it, err } - it.QuantityGTE = data - case "quantityLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.TodoIDs = data + case "subCategoryIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) if err != nil { return it, err } - it.QuantityLT = data - case "quantityLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("quantityLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.SubCategoryIDs = data + case "createTodos": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) + data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCreateTodoInputᚄ(ctx, v) if err != nil { return it, err } - it.QuantityLTE = data + if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { + return it, err + } } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryConfigInput(ctx context.Context, obj any) (schematype.CategoryConfig, error) { - var it schematype.CategoryConfig +func (ec *executionContext) unmarshalInputCreateDirectiveExampleInput(ctx context.Context, obj any) (CreateDirectiveExampleInput, error) { + var it CreateDirectiveExampleInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"maxMembers"} + fieldsInOrder := [...]string{"onTypeField", "onMutationFields", "onMutationCreate", "onMutationUpdate", "onAllFields"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "maxMembers": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("maxMembers")) - data, err := ec.unmarshalOInt2int(ctx, v) + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.MaxMembers = data + it.OnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationCreate = data + } else if tmp == nil { + it.OnMutationCreate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationUpdate = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryOrder(ctx context.Context, obj any) (ent.CategoryOrder, error) { - var it ent.CategoryOrder +func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { + var it ent.CreateTodoInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - if _, present := asMap["direction"]; !present { - asMap["direction"] = "ASC" - } - - fieldsInOrder := [...]string{"direction", "field"} + fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} 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) + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { + return it, err + } + case "priority": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Priority = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "init": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Init = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Value = data + case "parentID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.ParentID = data + case "childIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) if err != nil { return it, err } - it.Direction = data - case "field": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNCategoryOrderField2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryOrderField(ctx, v) + it.ChildIDs = 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.Field = data + it.CategoryID = data + case "secretID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) + data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.SecretID = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryTypesInput(ctx context.Context, obj any) (CategoryTypesInput, error) { - var it CategoryTypesInput +func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { + var it ent.CreateUserInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"public"} + fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "public": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("public")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Public = data + it.Name = data + case "username": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) + data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateUserInput().Username(ctx, &it, data); err != nil { + return it, err + } + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Password = data + case "requiredMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) + data, err := ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + it.RequiredMetadata = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "friendIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) + data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + if err != nil { + return it, err + } + it.FriendIDs = data } } return it, nil } -func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context, obj any) (ent.CategoryWhereInput, error) { - var it ent.CategoryWhereInput +func (ec *executionContext) unmarshalInputDirectiveExampleWhereInput(ctx context.Context, obj any) (DirectiveExampleWhereInput, error) { + var it DirectiveExampleWhereInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "config", "configNEQ", "configIn", "configNotIn", "configGT", "configGTE", "configLT", "configLTE", "configIsNil", "configNotNil", "duration", "durationNEQ", "durationIn", "durationNotIn", "durationGT", "durationGTE", "durationLT", "durationLTE", "durationIsNil", "durationNotNil", "count", "countNEQ", "countIn", "countNotIn", "countGT", "countGTE", "countLT", "countLTE", "countIsNil", "countNotNil", "hasTodos", "hasTodosWith", "hasSubCategories", "hasSubCategoriesWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "onTypeField", "onTypeFieldNEQ", "onTypeFieldIn", "onTypeFieldNotIn", "onTypeFieldGT", "onTypeFieldGTE", "onTypeFieldLT", "onTypeFieldLTE", "onTypeFieldContains", "onTypeFieldHasPrefix", "onTypeFieldHasSuffix", "onTypeFieldIsNil", "onTypeFieldNotNil", "onTypeFieldEqualFold", "onTypeFieldContainsFold", "onMutationFields", "onMutationFieldsNEQ", "onMutationFieldsIn", "onMutationFieldsNotIn", "onMutationFieldsGT", "onMutationFieldsGTE", "onMutationFieldsLT", "onMutationFieldsLTE", "onMutationFieldsContains", "onMutationFieldsHasPrefix", "onMutationFieldsHasSuffix", "onMutationFieldsIsNil", "onMutationFieldsNotNil", "onMutationFieldsEqualFold", "onMutationFieldsContainsFold", "onMutationCreate", "onMutationCreateNEQ", "onMutationCreateIn", "onMutationCreateNotIn", "onMutationCreateGT", "onMutationCreateGTE", "onMutationCreateLT", "onMutationCreateLTE", "onMutationCreateContains", "onMutationCreateHasPrefix", "onMutationCreateHasSuffix", "onMutationCreateIsNil", "onMutationCreateNotNil", "onMutationCreateEqualFold", "onMutationCreateContainsFold", "onMutationUpdate", "onMutationUpdateNEQ", "onMutationUpdateIn", "onMutationUpdateNotIn", "onMutationUpdateGT", "onMutationUpdateGTE", "onMutationUpdateLT", "onMutationUpdateLTE", "onMutationUpdateContains", "onMutationUpdateHasPrefix", "onMutationUpdateHasSuffix", "onMutationUpdateIsNil", "onMutationUpdateNotNil", "onMutationUpdateEqualFold", "onMutationUpdateContainsFold", "onAllFields", "onAllFieldsNEQ", "onAllFieldsIn", "onAllFieldsNotIn", "onAllFieldsGT", "onAllFieldsGTE", "onAllFieldsLT", "onAllFieldsLTE", "onAllFieldsContains", "onAllFieldsHasPrefix", "onAllFieldsHasSuffix", "onAllFieldsIsNil", "onAllFieldsNotNil", "onAllFieldsEqualFold", "onAllFieldsContainsFold"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -12989,21 +14362,21 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context switch k { case "not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("not")) - data, err := ec.unmarshalOCategoryWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryWhereInput(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInput(ctx, v) if err != nil { return it, err } it.Not = data case "and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } it.And = data case "or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryWhereInputᚄ(ctx, v) + data, err := ec.unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInputᚄ(ctx, v) if err != nil { return it, err } @@ -13021,7 +14394,7 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context if err != nil { return it, err } - it.IDNEQ = data + it.IDNeq = data case "idIn": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idIn")) data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) @@ -13042,635 +14415,553 @@ func (ec *executionContext) unmarshalInputCategoryWhereInput(ctx context.Context if err != nil { return it, err } - it.IDGT = data + 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 + 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 + 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 "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + it.IDLte = data + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Text = data - case "textNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + it.OnTypeField = data + case "onTypeFieldNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNEQ")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextNEQ = data - case "textIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + it.OnTypeFieldNeq = data + case "onTypeFieldIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextIn = data - case "textNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + it.OnTypeFieldIn = data + case "onTypeFieldNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotIn")) data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.TextNotIn = data - case "textGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGT = data - case "textGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.TextGTE = data - case "textLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + it.OnTypeFieldNotIn = data + case "onTypeFieldGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLT = data - case "textLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + it.OnTypeFieldGt = data + case "onTypeFieldGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextLTE = data - case "textContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + it.OnTypeFieldGte = data + case "onTypeFieldLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLT")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContains = data - case "textHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + it.OnTypeFieldLt = data + case "onTypeFieldLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldLTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasPrefix = data - case "textHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + it.OnTypeFieldLte = data + case "onTypeFieldContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextHasSuffix = data - case "textEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + it.OnTypeFieldContains = data + case "onTypeFieldHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasPrefix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextEqualFold = data - case "textContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + it.OnTypeFieldHasPrefix = data + case "onTypeFieldHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldHasSuffix")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TextContainsFold = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.Status = data - case "statusNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) - data, err := ec.unmarshalOCategoryStatus2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(ctx, v) - if err != nil { - return it, err - } - it.StatusNEQ = data - case "statusIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusIn = data - case "statusNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) - data, err := ec.unmarshalOCategoryStatus2ᚕentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatusᚄ(ctx, v) - if err != nil { - return it, err - } - it.StatusNotIn = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.Config = data - case "configNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNEQ")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) - if err != nil { - return it, err - } - it.ConfigNEQ = data - case "configIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) - if err != nil { - return it, err - } - it.ConfigIn = data - case "configNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotIn")) - data, err := ec.unmarshalOCategoryConfigInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfigᚄ(ctx, v) + it.OnTypeFieldHasSuffix = data + case "onTypeFieldIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.ConfigNotIn = data - case "configGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldIsNil = data + case "onTypeFieldNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.ConfigGT = data - case "configGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configGTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldNotNil = data + case "onTypeFieldEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigGTE = data - case "configLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLT")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldEqualFold = data + case "onTypeFieldContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeFieldContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLT = data - case "configLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configLTE")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnTypeFieldContainsFold = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigLTE = data - case "configIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFields = data + case "onMutationFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ConfigIsNil = data - case "configNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsNeq = data + case "onMutationFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.ConfigNotNil = data - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsIn = data + case "onMutationFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Duration = data - case "durationNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNEQ")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsNotIn = data + case "onMutationFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNEQ = data - case "durationIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGt = data + case "onMutationFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationIn = data - case "durationNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotIn")) - data, err := ec.unmarshalODuration2ᚕtimeᚐDurationᚄ(ctx, v) + it.OnMutationFieldsGte = data + case "onMutationFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationNotIn = data - case "durationGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLt = data + case "onMutationFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGT = data - case "durationGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationGTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsLte = data + case "onMutationFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationGTE = data - case "durationLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLT")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsContains = data + case "onMutationFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLT = data - case "durationLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationLTE")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationFieldsHasPrefix = data + case "onMutationFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.DurationLTE = data - case "durationIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsHasSuffix = data + case "onMutationFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.DurationIsNil = data - case "durationNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("durationNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationFieldsIsNil = data + case "onMutationFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.DurationNotNil = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsNotNil = data + case "onMutationFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Count = data - case "countNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNEQ")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationFieldsEqualFold = data + case "onMutationFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNEQ = data - case "countIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationFieldsContainsFold = data + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIn = data - case "countNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotIn")) - data, err := ec.unmarshalOUint642ᚕuint64ᚄ(ctx, v) + it.OnMutationCreate = data + case "onMutationCreateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotIn = data - case "countGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNeq = data + case "onMutationCreateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGT = data - case "countGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countGTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateIn = data + case "onMutationCreateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CountGTE = data - case "countLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLT")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateNotIn = data + case "onMutationCreateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLT = data - case "countLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countLTE")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationCreateGt = data + case "onMutationCreateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountLTE = data - case "countIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateGte = data + case "onMutationCreateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountIsNil = data - case "countNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) + it.OnMutationCreateLt = data + case "onMutationCreateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.CountNotNil = data - case "hasTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodos")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateLte = data + case "onMutationCreateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodos = data - case "hasTodosWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTodosWith")) - data, err := ec.unmarshalOTodoWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐTodoWhereInputᚄ(ctx, v) + it.OnMutationCreateContains = data + case "onMutationCreateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasTodosWith = data - case "hasSubCategories": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategories")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + it.OnMutationCreateHasPrefix = data + case "onMutationCreateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.HasSubCategories = data - case "hasSubCategoriesWith": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubCategoriesWith")) - data, err := ec.unmarshalOCategoryWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCategoryWhereInputᚄ(ctx, v) + it.OnMutationCreateHasSuffix = data + case "onMutationCreateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.HasSubCategoriesWith = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateCategoryInput(ctx context.Context, obj any) (ent.CreateCategoryInput, error) { - var it ent.CreateCategoryInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "status", "config", "types", "duration", "count", "strings", "todoIDs", "subCategoryIDs", "createTodos"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationCreateIsNil = data + case "onMutationCreateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Text = data - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNCategoryStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚋcategoryᚐStatus(ctx, v) + it.OnMutationCreateNotNil = data + case "onMutationCreateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Status = data - case "config": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - data, err := ec.unmarshalOCategoryConfigInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋschemaᚋschematypeᚐCategoryConfig(ctx, v) + it.OnMutationCreateEqualFold = data + case "onMutationCreateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Config = data - case "types": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("types")) - data, err := ec.unmarshalOCategoryTypesInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐCategoryTypesInput(ctx, v) + it.OnMutationCreateContainsFold = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateCategoryInput().Types(ctx, &it, data); err != nil { + it.OnMutationUpdate = data + case "onMutationUpdateNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "duration": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalODuration2ᚖtimeᚐDuration(ctx, v) + it.OnMutationUpdateNeq = data + case "onMutationUpdateIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Duration = data - case "count": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) - data, err := ec.unmarshalOUint642ᚖuint64(ctx, v) + it.OnMutationUpdateIn = data + case "onMutationUpdateNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.Count = data - case "strings": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("strings")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.OnMutationUpdateNotIn = data + case "onMutationUpdateGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Strings = data - case "todoIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("todoIDs")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.OnMutationUpdateGt = data + case "onMutationUpdateGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.TodoIDs = data - case "subCategoryIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subCategoryIDs")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.OnMutationUpdateGte = data + case "onMutationUpdateLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.SubCategoryIDs = data - case "createTodos": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createTodos")) - data, err := ec.unmarshalOCreateTodoInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚋentᚐCreateTodoInputᚄ(ctx, v) + it.OnMutationUpdateLt = data + case "onMutationUpdateLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateCategoryInput().CreateTodos(ctx, &it, data); err != nil { + it.OnMutationUpdateLte = data + case "onMutationUpdateContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateTodoInput(ctx context.Context, obj any) (ent.CreateTodoInput, error) { - var it ent.CreateTodoInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"status", "priority", "text", "init", "value", "parentID", "childIDs", "categoryID", "secretID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "status": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) - data, err := ec.unmarshalNTodoStatus2entgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodoᚋentᚋtodoᚐStatus(ctx, v) + it.OnMutationUpdateContains = data + case "onMutationUpdateHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateTodoInput().Status(ctx, &it, data); err != nil { + it.OnMutationUpdateHasPrefix = data + case "onMutationUpdateHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "priority": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateHasSuffix = data + case "onMutationUpdateIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Priority = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalNString2string(ctx, v) + it.OnMutationUpdateIsNil = data + case "onMutationUpdateNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Text = data - case "init": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("init")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnMutationUpdateNotNil = data + case "onMutationUpdateEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Init = data - case "value": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.OnMutationUpdateEqualFold = data + case "onMutationUpdateContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdateContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Value = data - case "parentID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.OnMutationUpdateContainsFold = data + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ParentID = data - case "childIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("childIDs")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.OnAllFields = data + case "onAllFieldsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.ChildIDs = data - case "categoryID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryID")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.OnAllFieldsNeq = data + case "onAllFieldsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.CategoryID = data - case "secretID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretID")) - data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + it.OnAllFieldsIn = data + case "onAllFieldsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) if err != nil { return it, err } - it.SecretID = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj any) (ent.CreateUserInput, error) { - var it ent.CreateUserInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"name", "username", "password", "requiredMetadata", "metadata", "groupIDs", "friendIDs"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.OnAllFieldsNotIn = data + case "onAllFieldsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsGt = data + case "onAllFieldsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsGTE")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Name = data - case "username": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) - data, err := ec.unmarshalOUUID2ᚖstring(ctx, v) + it.OnAllFieldsGte = data + case "onAllFieldsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - if err = ec.resolvers.CreateUserInput().Username(ctx, &it, data); err != nil { + it.OnAllFieldsLt = data + case "onAllFieldsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { return it, err } - case "password": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + it.OnAllFieldsLte = data + case "onAllFieldsContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContains")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Password = data - case "requiredMetadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requiredMetadata")) - data, err := ec.unmarshalNMap2map(ctx, v) + it.OnAllFieldsContains = data + case "onAllFieldsHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.RequiredMetadata = data - case "metadata": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMap2map(ctx, v) + it.OnAllFieldsHasPrefix = data + case "onAllFieldsHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Metadata = data - case "groupIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.OnAllFieldsHasSuffix = data + case "onAllFieldsIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsIsNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.GroupIDs = data - case "friendIDs": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("friendIDs")) - data, err := ec.unmarshalOID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, v) + it.OnAllFieldsIsNil = data + case "onAllFieldsNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsNotNil")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.FriendIDs = data + it.OnAllFieldsNotNil = data + case "onAllFieldsEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsEqualFold = data + case "onAllFieldsContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFieldsContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnAllFieldsContainsFold = data } } @@ -15368,6 +16659,198 @@ func (ec *executionContext) unmarshalInputUpdateCategoryInput(ctx context.Contex return it, nil } +func (ec *executionContext) unmarshalInputUpdateDirectiveExampleInput(ctx context.Context, obj any) (UpdateDirectiveExampleInput, error) { + var it UpdateDirectiveExampleInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"onTypeField", "clearOnTypeField", "onMutationFields", "clearOnMutationFields", "onMutationCreate", "clearOnMutationCreate", "onMutationUpdate", "clearOnMutationUpdate", "onAllFields", "clearOnAllFields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "onTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onTypeField")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnTypeField = data + case "clearOnTypeField": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnTypeField")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnTypeField = data + case "onMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationFields = data + } else if tmp == nil { + it.OnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationFields = data + } else if tmp == nil { + it.ClearOnMutationFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationCreate")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OnMutationCreate = data + case "clearOnMutationCreate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationCreate")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClearOnMutationCreate = data + case "onMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnMutationUpdate = data + } else if tmp == nil { + it.OnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnMutationUpdate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnMutationUpdate")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnMutationUpdate = data + } else if tmp == nil { + it.ClearOnMutationUpdate = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "onAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("onAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *string + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + it.OnAllFields = data + } else if tmp == nil { + it.OnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "clearOnAllFields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOnAllFields")) + directive0 := func(ctx context.Context) (any, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } + + directive1 := func(ctx context.Context) (any, error) { + if ec.directives.FieldDirective == nil { + var zeroVal *bool + return zeroVal, errors.New("directive fieldDirective is not implemented") + } + return ec.directives.FieldDirective(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*bool); ok { + it.ClearOnAllFields = data + } else if tmp == nil { + it.ClearOnAllFields = nil + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputUpdateFriendshipInput(ctx context.Context, obj any) (UpdateFriendshipInput, error) { var it UpdateFriendshipInput asMap := map[string]any{} @@ -16012,6 +17495,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Category(ctx, sel, obj) + case DirectiveExample: + return ec._DirectiveExample(ctx, sel, &obj) + case *DirectiveExample: + if obj == nil { + return graphql.Null + } + return ec._DirectiveExample(ctx, sel, obj) case *ent.Friendship: if obj == nil { return graphql.Null @@ -16502,6 +17992,55 @@ func (ec *executionContext) _Custom(ctx context.Context, sel ast.SelectionSet, o return out } +var directiveExampleImplementors = []string{"DirectiveExample", "Node"} + +func (ec *executionContext) _DirectiveExample(ctx context.Context, sel ast.SelectionSet, obj *DirectiveExample) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, directiveExampleImplementors) + + 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("DirectiveExample") + case "id": + out.Values[i] = ec._DirectiveExample_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "onTypeField": + out.Values[i] = ec._DirectiveExample_onTypeField(ctx, field, obj) + case "onMutationFields": + out.Values[i] = ec._DirectiveExample_onMutationFields(ctx, field, obj) + case "onMutationCreate": + out.Values[i] = ec._DirectiveExample_onMutationCreate(ctx, field, obj) + case "onMutationUpdate": + out.Values[i] = ec._DirectiveExample_onMutationUpdate(ctx, field, obj) + case "onAllFields": + out.Values[i] = ec._DirectiveExample_onAllFields(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 friendshipImplementors = []string{"Friendship", "Node"} func (ec *executionContext) _Friendship(ctx context.Context, sel ast.SelectionSet, obj *ent.Friendship) graphql.Marshaler { @@ -17366,6 +18905,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "directiveExamples": + 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_directiveExamples(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 "groups": field := field @@ -18639,6 +20200,65 @@ func (ec *executionContext) marshalNCustom2entgoᚗioᚋcontribᚋentgqlᚋinter return ec._Custom(ctx, sel, &v) } +func (ec *executionContext) marshalNDirectiveExample2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleᚄ(ctx context.Context, sel ast.SelectionSet, v []*DirectiveExample) 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.marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExample(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDirectiveExample2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExample(ctx context.Context, sel ast.SelectionSet, v *DirectiveExample) 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._DirectiveExample(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNDuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) @@ -19785,6 +21405,34 @@ func (ec *executionContext) marshalOCustom2ᚖentgoᚗioᚋcontribᚋentgqlᚋin return ec._Custom(ctx, sel, v) } +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚕᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInputᚄ(ctx context.Context, v any) ([]*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []any + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*DirectiveExampleWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODirectiveExampleWhereInput2ᚖentgoᚗioᚋcontribᚋentgqlᚋinternalᚋtodouuidᚐDirectiveExampleWhereInput(ctx context.Context, v any) (*DirectiveExampleWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDirectiveExampleWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalODuration2timeᚐDuration(ctx context.Context, v any) (time.Duration, error) { res, err := durationgql.UnmarshalDuration(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/entgql/internal/todouuid/models_gen.go b/entgql/internal/todouuid/models_gen.go index f368391f0..c3e57480f 100644 --- a/entgql/internal/todouuid/models_gen.go +++ b/entgql/internal/todouuid/models_gen.go @@ -25,6 +25,124 @@ type CategoryTypesInput struct { Public *bool `json:"public,omitempty"` } +// CreateDirectiveExampleInput is used for create DirectiveExample object. +// Input was generated by ent. +type CreateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + +type DirectiveExample struct { + ID uuid.UUID `json:"id"` + OnTypeField *string `json:"onTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` +} + +func (DirectiveExample) IsNode() {} + +// DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +// Input was generated by ent. +type DirectiveExampleWhereInput struct { + Not *DirectiveExampleWhereInput `json:"not,omitempty"` + And []*DirectiveExampleWhereInput `json:"and,omitempty"` + Or []*DirectiveExampleWhereInput `json:"or,omitempty"` + // id field predicates + ID *uuid.UUID `json:"id,omitempty"` + IDNeq *uuid.UUID `json:"idNEQ,omitempty"` + IDIn []uuid.UUID `json:"idIn,omitempty"` + IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` + IDGt *uuid.UUID `json:"idGT,omitempty"` + IDGte *uuid.UUID `json:"idGTE,omitempty"` + IDLt *uuid.UUID `json:"idLT,omitempty"` + IDLte *uuid.UUID `json:"idLTE,omitempty"` + // on_type_field field predicates + OnTypeField *string `json:"onTypeField,omitempty"` + OnTypeFieldNeq *string `json:"onTypeFieldNEQ,omitempty"` + OnTypeFieldIn []string `json:"onTypeFieldIn,omitempty"` + OnTypeFieldNotIn []string `json:"onTypeFieldNotIn,omitempty"` + OnTypeFieldGt *string `json:"onTypeFieldGT,omitempty"` + OnTypeFieldGte *string `json:"onTypeFieldGTE,omitempty"` + OnTypeFieldLt *string `json:"onTypeFieldLT,omitempty"` + OnTypeFieldLte *string `json:"onTypeFieldLTE,omitempty"` + OnTypeFieldContains *string `json:"onTypeFieldContains,omitempty"` + OnTypeFieldHasPrefix *string `json:"onTypeFieldHasPrefix,omitempty"` + OnTypeFieldHasSuffix *string `json:"onTypeFieldHasSuffix,omitempty"` + OnTypeFieldIsNil *bool `json:"onTypeFieldIsNil,omitempty"` + OnTypeFieldNotNil *bool `json:"onTypeFieldNotNil,omitempty"` + OnTypeFieldEqualFold *string `json:"onTypeFieldEqualFold,omitempty"` + OnTypeFieldContainsFold *string `json:"onTypeFieldContainsFold,omitempty"` + // on_mutation_fields field predicates + OnMutationFields *string `json:"onMutationFields,omitempty"` + OnMutationFieldsNeq *string `json:"onMutationFieldsNEQ,omitempty"` + OnMutationFieldsIn []string `json:"onMutationFieldsIn,omitempty"` + OnMutationFieldsNotIn []string `json:"onMutationFieldsNotIn,omitempty"` + OnMutationFieldsGt *string `json:"onMutationFieldsGT,omitempty"` + OnMutationFieldsGte *string `json:"onMutationFieldsGTE,omitempty"` + OnMutationFieldsLt *string `json:"onMutationFieldsLT,omitempty"` + OnMutationFieldsLte *string `json:"onMutationFieldsLTE,omitempty"` + OnMutationFieldsContains *string `json:"onMutationFieldsContains,omitempty"` + OnMutationFieldsHasPrefix *string `json:"onMutationFieldsHasPrefix,omitempty"` + OnMutationFieldsHasSuffix *string `json:"onMutationFieldsHasSuffix,omitempty"` + OnMutationFieldsIsNil *bool `json:"onMutationFieldsIsNil,omitempty"` + OnMutationFieldsNotNil *bool `json:"onMutationFieldsNotNil,omitempty"` + OnMutationFieldsEqualFold *string `json:"onMutationFieldsEqualFold,omitempty"` + OnMutationFieldsContainsFold *string `json:"onMutationFieldsContainsFold,omitempty"` + // on_mutation_create field predicates + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + OnMutationCreateNeq *string `json:"onMutationCreateNEQ,omitempty"` + OnMutationCreateIn []string `json:"onMutationCreateIn,omitempty"` + OnMutationCreateNotIn []string `json:"onMutationCreateNotIn,omitempty"` + OnMutationCreateGt *string `json:"onMutationCreateGT,omitempty"` + OnMutationCreateGte *string `json:"onMutationCreateGTE,omitempty"` + OnMutationCreateLt *string `json:"onMutationCreateLT,omitempty"` + OnMutationCreateLte *string `json:"onMutationCreateLTE,omitempty"` + OnMutationCreateContains *string `json:"onMutationCreateContains,omitempty"` + OnMutationCreateHasPrefix *string `json:"onMutationCreateHasPrefix,omitempty"` + OnMutationCreateHasSuffix *string `json:"onMutationCreateHasSuffix,omitempty"` + OnMutationCreateIsNil *bool `json:"onMutationCreateIsNil,omitempty"` + OnMutationCreateNotNil *bool `json:"onMutationCreateNotNil,omitempty"` + OnMutationCreateEqualFold *string `json:"onMutationCreateEqualFold,omitempty"` + OnMutationCreateContainsFold *string `json:"onMutationCreateContainsFold,omitempty"` + // on_mutation_update field predicates + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + OnMutationUpdateNeq *string `json:"onMutationUpdateNEQ,omitempty"` + OnMutationUpdateIn []string `json:"onMutationUpdateIn,omitempty"` + OnMutationUpdateNotIn []string `json:"onMutationUpdateNotIn,omitempty"` + OnMutationUpdateGt *string `json:"onMutationUpdateGT,omitempty"` + OnMutationUpdateGte *string `json:"onMutationUpdateGTE,omitempty"` + OnMutationUpdateLt *string `json:"onMutationUpdateLT,omitempty"` + OnMutationUpdateLte *string `json:"onMutationUpdateLTE,omitempty"` + OnMutationUpdateContains *string `json:"onMutationUpdateContains,omitempty"` + OnMutationUpdateHasPrefix *string `json:"onMutationUpdateHasPrefix,omitempty"` + OnMutationUpdateHasSuffix *string `json:"onMutationUpdateHasSuffix,omitempty"` + OnMutationUpdateIsNil *bool `json:"onMutationUpdateIsNil,omitempty"` + OnMutationUpdateNotNil *bool `json:"onMutationUpdateNotNil,omitempty"` + OnMutationUpdateEqualFold *string `json:"onMutationUpdateEqualFold,omitempty"` + OnMutationUpdateContainsFold *string `json:"onMutationUpdateContainsFold,omitempty"` + // on_all_fields field predicates + OnAllFields *string `json:"onAllFields,omitempty"` + OnAllFieldsNeq *string `json:"onAllFieldsNEQ,omitempty"` + OnAllFieldsIn []string `json:"onAllFieldsIn,omitempty"` + OnAllFieldsNotIn []string `json:"onAllFieldsNotIn,omitempty"` + OnAllFieldsGt *string `json:"onAllFieldsGT,omitempty"` + OnAllFieldsGte *string `json:"onAllFieldsGTE,omitempty"` + OnAllFieldsLt *string `json:"onAllFieldsLT,omitempty"` + OnAllFieldsLte *string `json:"onAllFieldsLTE,omitempty"` + OnAllFieldsContains *string `json:"onAllFieldsContains,omitempty"` + OnAllFieldsHasPrefix *string `json:"onAllFieldsHasPrefix,omitempty"` + OnAllFieldsHasSuffix *string `json:"onAllFieldsHasSuffix,omitempty"` + OnAllFieldsIsNil *bool `json:"onAllFieldsIsNil,omitempty"` + OnAllFieldsNotNil *bool `json:"onAllFieldsNotNil,omitempty"` + OnAllFieldsEqualFold *string `json:"onAllFieldsEqualFold,omitempty"` + OnAllFieldsContainsFold *string `json:"onAllFieldsContainsFold,omitempty"` +} + type OneToMany struct { ID uuid.UUID `json:"id"` Name string `json:"name"` @@ -172,6 +290,21 @@ type ProjectWhereInput struct { HasTodosWith []*ent.TodoWhereInput `json:"hasTodosWith,omitempty"` } +// UpdateDirectiveExampleInput is used for update DirectiveExample object. +// Input was generated by ent. +type UpdateDirectiveExampleInput struct { + OnTypeField *string `json:"onTypeField,omitempty"` + ClearOnTypeField *bool `json:"clearOnTypeField,omitempty"` + OnMutationFields *string `json:"onMutationFields,omitempty"` + ClearOnMutationFields *bool `json:"clearOnMutationFields,omitempty"` + OnMutationCreate *string `json:"onMutationCreate,omitempty"` + ClearOnMutationCreate *bool `json:"clearOnMutationCreate,omitempty"` + OnMutationUpdate *string `json:"onMutationUpdate,omitempty"` + ClearOnMutationUpdate *bool `json:"clearOnMutationUpdate,omitempty"` + OnAllFields *string `json:"onAllFields,omitempty"` + ClearOnAllFields *bool `json:"clearOnAllFields,omitempty"` +} + // UpdateFriendshipInput is used for update Friendship object. // Input was generated by ent. type UpdateFriendshipInput struct { diff --git a/entgql/schema.go b/entgql/schema.go index ddf08a8a4..a7f95c3d1 100644 --- a/entgql/schema.go +++ b/entgql/schema.go @@ -586,6 +586,14 @@ func (e *schemaGenerator) buildMutationInputs(t *gen.Type, ant *Annotation, gqlT if err != nil { return nil, err } + var dd []Directive + for _, d := range ant.Directives { + if (i.IsCreate && d.AddCreateMutationField) || (!i.IsCreate && d.AddUpdateMutationField) { + dd = append(dd, d) + } + } + fdd := e.buildDirectives(dd) + scalar := e.mapScalar(gqlType, f.Field, ant, inputObjectFilter) if scalar == "" { return nil, fmt.Errorf("%s is not supported as input for %s", f.Name, def.Name) @@ -594,17 +602,20 @@ func (e *schemaGenerator) buildMutationInputs(t *gen.Type, ant *Annotation, gqlT Name: camel(f.Name), Type: namedType(scalar, f.Nullable), Description: f.Comment(), + Directives: fdd, }) if f.AppendOp { def.Fields = append(def.Fields, &ast.FieldDefinition{ - Name: "append" + f.StructField(), - Type: namedType(scalar, true), + Name: "append" + f.StructField(), + Type: namedType(scalar, true), + Directives: fdd, }) } if f.ClearOp { def.Fields = append(def.Fields, &ast.FieldDefinition{ - Name: "clear" + f.StructField(), - Type: namedType("Boolean", true), + Name: "clear" + f.StructField(), + Type: namedType("Boolean", true), + Directives: fdd, }) } } @@ -657,12 +668,18 @@ func (e *schemaGenerator) fieldDefinitions(gqlType string, f *gen.Field, ant *An if err != nil { return nil, err } + var dd []Directive + for _, d := range ant.Directives { + if !d.SkipTypeField { + dd = append(dd, d) + } + } for _, name := range mapping { def := &ast.FieldDefinition{ Name: name, Type: ft, Description: f.Comment(), - Directives: e.buildDirectives(ant.Directives), + Directives: e.buildDirectives(dd), } // We check the field name with gqlgen's naming convention. // To avoid unnecessary @goField directives diff --git a/entgql/testdata/schema.graphql b/entgql/testdata/schema.graphql index 289e579b3..36a802f3e 100644 --- a/entgql/testdata/schema.graphql +++ b/entgql/testdata/schema.graphql @@ -63,6 +63,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -90,6 +101,14 @@ input CreateUserInput { groupIDs: [ID!] friendIDs: [ID!] } +type DirectiveExample { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} type Friendship { id: ID! createdAt: Time! @@ -144,6 +163,7 @@ type Project { type Query { billProducts: [BillProduct!]! categories: [Category!]! + directiveExamples: [DirectiveExample!]! groups: [Group!]! oneToMany: [OneToMany!]! """ @@ -236,6 +256,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ diff --git a/entgql/testdata/schema_output.graphql b/entgql/testdata/schema_output.graphql index 289e579b3..36a802f3e 100644 --- a/entgql/testdata/schema_output.graphql +++ b/entgql/testdata/schema_output.graphql @@ -63,6 +63,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -90,6 +101,14 @@ input CreateUserInput { groupIDs: [ID!] friendIDs: [ID!] } +type DirectiveExample { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} type Friendship { id: ID! createdAt: Time! @@ -144,6 +163,7 @@ type Project { type Query { billProducts: [BillProduct!]! categories: [Category!]! + directiveExamples: [DirectiveExample!]! groups: [Group!]! oneToMany: [OneToMany!]! """ @@ -236,6 +256,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ diff --git a/entgql/testdata/schema_relay.graphql b/entgql/testdata/schema_relay.graphql index 8f0d69b91..dd3ccb422 100644 --- a/entgql/testdata/schema_relay.graphql +++ b/entgql/testdata/schema_relay.graphql @@ -308,6 +308,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -335,6 +346,124 @@ input CreateUserInput { groupIDs: [ID!] friendIDs: [ID!] } +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -784,6 +913,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -1151,6 +1281,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """ diff --git a/entgql/testdata/schema_relay_output.graphql b/entgql/testdata/schema_relay_output.graphql index 8f0d69b91..dd3ccb422 100644 --- a/entgql/testdata/schema_relay_output.graphql +++ b/entgql/testdata/schema_relay_output.graphql @@ -308,6 +308,17 @@ input CreateCategoryInput { subCategoryIDs: [ID!] } """ +CreateDirectiveExampleInput is used for create DirectiveExample object. +Input was generated by ent. +""" +input CreateDirectiveExampleInput { + onTypeField: String + onMutationFields: String @fieldDirective + onMutationCreate: String @fieldDirective + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" CreateTodoInput is used for create Todo object. Input was generated by ent. """ @@ -335,6 +346,124 @@ input CreateUserInput { groupIDs: [ID!] friendIDs: [ID!] } +type DirectiveExample implements Node { + id: ID! + onTypeField: String @fieldDirective + onMutationFields: String + onMutationCreate: String + onMutationUpdate: String + onAllFields: String @fieldDirective +} +""" +DirectiveExampleWhereInput is used for filtering DirectiveExample objects. +Input was generated by ent. +""" +input DirectiveExampleWhereInput { + not: DirectiveExampleWhereInput + and: [DirectiveExampleWhereInput!] + or: [DirectiveExampleWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + """ + on_type_field field predicates + """ + onTypeField: String + onTypeFieldNEQ: String + onTypeFieldIn: [String!] + onTypeFieldNotIn: [String!] + onTypeFieldGT: String + onTypeFieldGTE: String + onTypeFieldLT: String + onTypeFieldLTE: String + onTypeFieldContains: String + onTypeFieldHasPrefix: String + onTypeFieldHasSuffix: String + onTypeFieldIsNil: Boolean + onTypeFieldNotNil: Boolean + onTypeFieldEqualFold: String + onTypeFieldContainsFold: String + """ + on_mutation_fields field predicates + """ + onMutationFields: String + onMutationFieldsNEQ: String + onMutationFieldsIn: [String!] + onMutationFieldsNotIn: [String!] + onMutationFieldsGT: String + onMutationFieldsGTE: String + onMutationFieldsLT: String + onMutationFieldsLTE: String + onMutationFieldsContains: String + onMutationFieldsHasPrefix: String + onMutationFieldsHasSuffix: String + onMutationFieldsIsNil: Boolean + onMutationFieldsNotNil: Boolean + onMutationFieldsEqualFold: String + onMutationFieldsContainsFold: String + """ + on_mutation_create field predicates + """ + onMutationCreate: String + onMutationCreateNEQ: String + onMutationCreateIn: [String!] + onMutationCreateNotIn: [String!] + onMutationCreateGT: String + onMutationCreateGTE: String + onMutationCreateLT: String + onMutationCreateLTE: String + onMutationCreateContains: String + onMutationCreateHasPrefix: String + onMutationCreateHasSuffix: String + onMutationCreateIsNil: Boolean + onMutationCreateNotNil: Boolean + onMutationCreateEqualFold: String + onMutationCreateContainsFold: String + """ + on_mutation_update field predicates + """ + onMutationUpdate: String + onMutationUpdateNEQ: String + onMutationUpdateIn: [String!] + onMutationUpdateNotIn: [String!] + onMutationUpdateGT: String + onMutationUpdateGTE: String + onMutationUpdateLT: String + onMutationUpdateLTE: String + onMutationUpdateContains: String + onMutationUpdateHasPrefix: String + onMutationUpdateHasSuffix: String + onMutationUpdateIsNil: Boolean + onMutationUpdateNotNil: Boolean + onMutationUpdateEqualFold: String + onMutationUpdateContainsFold: String + """ + on_all_fields field predicates + """ + onAllFields: String + onAllFieldsNEQ: String + onAllFieldsIn: [String!] + onAllFieldsNotIn: [String!] + onAllFieldsGT: String + onAllFieldsGTE: String + onAllFieldsLT: String + onAllFieldsLTE: String + onAllFieldsContains: String + onAllFieldsHasPrefix: String + onAllFieldsHasSuffix: String + onAllFieldsIsNil: Boolean + onAllFieldsNotNil: Boolean + onAllFieldsEqualFold: String + onAllFieldsContainsFold: String +} type Friendship implements Node { id: ID! createdAt: Time! @@ -784,6 +913,7 @@ type Query { """ where: CategoryWhereInput ): CategoryConnection! + directiveExamples: [DirectiveExample!]! groups( """ Returns the elements in the list that come after the specified cursor. @@ -1151,6 +1281,22 @@ input UpdateCategoryInput { clearSubCategories: Boolean } """ +UpdateDirectiveExampleInput is used for update DirectiveExample object. +Input was generated by ent. +""" +input UpdateDirectiveExampleInput { + onTypeField: String + clearOnTypeField: Boolean + onMutationFields: String @fieldDirective + clearOnMutationFields: Boolean @fieldDirective + onMutationCreate: String + clearOnMutationCreate: Boolean + onMutationUpdate: String @fieldDirective + clearOnMutationUpdate: Boolean @fieldDirective + onAllFields: String @fieldDirective + clearOnAllFields: Boolean @fieldDirective +} +""" UpdateFriendshipInput is used for update Friendship object. Input was generated by ent. """