From 0635bc255d36b00c828da604c1873737eb759218 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:18:41 +0700 Subject: [PATCH 1/6] entgql: bump entgo and update template for receiver logic --- entgql/template/collection.tmpl | 29 ++++++++++++-------------- go.mod | 18 +++++++++-------- go.sum | 36 ++++++++++++++++++--------------- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/entgql/template/collection.tmpl b/entgql/template/collection.tmpl index 5ab8691e1..1901de025 100644 --- a/entgql/template/collection.tmpl +++ b/entgql/template/collection.tmpl @@ -21,12 +21,9 @@ import ( {{- end }} ) -{{ range $node := $gqlNodes }} -{{ $names := nodePaginationNames $node }} -{{ $name := $names.Node }} - -{{ $receiver := $node.Receiver }} -{{ $query := $node.QueryName }} +{{ range $node := $gqlNodes -}} +{{- $query := $node.QueryName -}} +{{- $receiver := $node.QueryReceiver -}} // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func ({{ $receiver }} *{{ $query }}) CollectFields(ctx context.Context, satisfies ...string) (*{{ $query }}, error) { fc := graphql.GetFieldContext(ctx) @@ -185,13 +182,14 @@ func ({{ $receiver }} *{{ $query }}) collectField(ctx context.Context, oneNode b return nil } -{{ $order := $names.Order }} -{{ $multiOrder := $node.Annotations.EntGQL.MultiOrder }} -{{ $orderField := $names.OrderField }} -{{ $filter := print "With" $name "Filter" }} -{{ $paginateArg := print (camel $name) "PaginateArgs" }} -{{ $newPaginateArg := print "new" $name "PaginateArgs" }} - +{{ $names := nodePaginationNames $node -}} +{{- $name := $names.Node -}} +{{- $filter := print "With" $name "Filter" -}} +{{- $paginateArg := print (camel $name) "PaginateArgs" -}} +{{- $newPaginateArg := print "new" $name "PaginateArgs" -}} +{{- $order := $names.Order -}} +{{- $multiOrder := $node.Annotations.EntGQL.MultiOrder -}} +{{- $orderField := $names.OrderField -}} type {{ $paginateArg }} struct { first, last *int after, before *Cursor @@ -409,7 +407,7 @@ Cond: {{- end }} {{- define "dialect/sql/query/spec/internal_modify" }} {{- if and ($.FeatureEnabled "sql/lock" | not) ($.FeatureEnabled "sql/modifier" | not) }} - {{- $receiver := pascal $.Scope.Builder | receiver }} + {{- $receiver := $.Scope.Receiver }} if len({{ $receiver }}.modifiers) > 0 { _spec.Modifiers = {{ $receiver }}.modifiers } @@ -421,8 +419,7 @@ Cond: loadTotal []func(context.Context, []*{{ $.Name }}) error {{- end }} {{ define "dialect/sql/query/all/nodes/namedges_load_total" }} - {{- $builder := pascal $.Scope.Builder }} - {{- $receiver := receiver $builder }} + {{- $receiver := $.Scope.Receiver }} for i := range {{ $receiver }}.loadTotal { if err := {{ $receiver }}.loadTotal[i](ctx, nodes); err != nil { return nil, err diff --git a/go.mod b/go.mod index 955446e17..348f45cdc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module entgo.io/contrib go 1.23.4 require ( - entgo.io/ent v0.14.2-0.20250116103911-b91f8daf0e32 + entgo.io/ent v0.14.4 github.com/99designs/gqlgen v0.17.63 github.com/AlekSi/pointer v1.1.0 github.com/alecthomas/kong v0.7.0 @@ -23,8 +23,8 @@ require ( go.uber.org/multierr v1.9.0 go.uber.org/zap v1.24.0 golang.org/x/exp v0.0.0-20221230185412-738e83a70c30 - golang.org/x/sync v0.10.0 - golang.org/x/tools v0.24.0 + golang.org/x/sync v0.11.0 + golang.org/x/tools v0.30.0 google.golang.org/grpc v1.52.3 google.golang.org/protobuf v1.36.1 ) @@ -32,11 +32,12 @@ require ( require github.com/golang/protobuf v1.5.4 // indirect require ( - ariga.io/atlas v0.27.1-0.20240912191503-92195304dbe1 // indirect + ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 // indirect github.com/agext/levenshtein v1.2.1 // indirect github.com/agnivade/levenshtein v1.2.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect @@ -60,11 +61,12 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.14.4 // indirect + github.com/zclconf/go-cty-yaml v1.1.0 // indirect go.uber.org/atomic v1.10.0 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/mod v0.23.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 8d7fa3678..0b9a90347 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ -ariga.io/atlas v0.27.1-0.20240912191503-92195304dbe1 h1:tqUmxmE7r2qqWmgczyNZNOyhzXLqmdUpRhVSuvCUqTU= -ariga.io/atlas v0.27.1-0.20240912191503-92195304dbe1/go.mod h1:cpxrs2J9HTrjMrfNKFmUpONY9L0vzAHZ1pY++nTtVw0= +ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 h1:nX4HXncwIdvQ8/8sIUIf1nyCkK8qdBaHQ7EtzPpuiGE= +ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83/go.mod h1:Oe1xWPuu5q9LzyrWfbZmEZxFYeu4BHTyzfjeW2aZp/w= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -entgo.io/ent v0.14.2-0.20250116103911-b91f8daf0e32 h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI= -entgo.io/ent v0.14.2-0.20250116103911-b91f8daf0e32/go.mod h1:nPwpHTcyAjBMt+hT6q7Y/SdF41e6IJudQPbTj1P5nYY= +entgo.io/ent v0.14.4 h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI= +entgo.io/ent v0.14.4/go.mod h1:aDPE/OziPEu8+OWbzy4UlvWmD2/kbRuWfK2A40hcxJM= github.com/99designs/gqlgen v0.17.63 h1:HCdaYDPd9HqUXRchEvmE3EFzELRwLlaJ8DBuyC8Cqto= github.com/99designs/gqlgen v0.17.63/go.mod h1:sVCM2iwIZisJjTI/DEC3fpH+HFgxY1496ZJ+jbT9IjA= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -34,6 +34,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0= +github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -164,6 +166,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-yaml v1.1.0 h1:nP+jp0qPHv2IhUVqmQSzjvqAWcObN0KBkUl2rWBdig0= +github.com/zclconf/go-cty-yaml v1.1.0/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= @@ -185,8 +189,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -195,16 +199,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -214,11 +218,11 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -227,8 +231,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 4be4cabb629c713645505b7f8186e56832eeba6c Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:18:54 +0700 Subject: [PATCH 2/6] entgql: codegen --- entgql/internal/todo/ent/gql_collection.go | 194 +++++++++--------- entgql/internal/todo/ent/runtime/runtime.go | 4 +- entgql/internal/todofed/ent/gql_collection.go | 40 ++-- .../internal/todofed/ent/runtime/runtime.go | 4 +- .../todoglobalid/ent/gql_collection.go | 194 +++++++++--------- .../todoglobalid/ent/migrate/schema.go | 20 +- .../todoglobalid/ent/runtime/runtime.go | 4 +- .../internal/todogotype/ent/gql_collection.go | 148 ++++++------- .../todogotype/ent/runtime/runtime.go | 4 +- entgql/internal/todogotype/generated.go | 4 +- .../internal/todopulid/ent/gql_collection.go | 136 ++++++------ .../internal/todopulid/ent/runtime/runtime.go | 4 +- .../internal/todouuid/ent/gql_collection.go | 136 ++++++------ .../internal/todouuid/ent/runtime/runtime.go | 4 +- 14 files changed, 448 insertions(+), 448 deletions(-) diff --git a/entgql/internal/todo/ent/gql_collection.go b/entgql/internal/todo/ent/gql_collection.go index ebe4ddd37..661eef1fb 100644 --- a/entgql/internal/todo/ent/gql_collection.go +++ b/entgql/internal/todo/ent/gql_collection.go @@ -36,18 +36,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { +func (bpq *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return bp, nil + return bpq, nil } - if err := bp.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := bpq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return bp, nil + return bpq, nil } -func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (bpq *BillProductQuery) 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 @@ -78,7 +78,7 @@ func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCt } } if !unknownSeen { - bp.Select(selectedFields...) + bpq.Select(selectedFields...) } return nil } @@ -113,18 +113,18 @@ func newBillProductPaginateArgs(rv map[string]any) *billproductPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -138,7 +138,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -156,7 +156,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -185,7 +185,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -219,7 +219,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) @@ -227,7 +227,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: c.config}).Query() + query = (&CategoryClient{config: cq.config}).Query() ) args := newCategoryPaginateArgs(fieldArgs(ctx, new(CategoryWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -245,7 +245,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -278,7 +278,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.SubCategories) if nodes[i].Edges.totalCount[1] == nil { @@ -312,7 +312,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedSubCategories(alias, func(wq *CategoryQuery) { + cq.WithNamedSubCategories(alias, func(wq *CategoryQuery) { *wq = *query }) case "text": @@ -357,7 +357,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -420,18 +420,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { +func (fq *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return f, nil + return fq, nil } - if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := fq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return f, nil + return fq, nil } -func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (fq *FriendshipQuery) 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 @@ -445,12 +445,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withUser = query + fq.withUser = query if _, ok := fieldSeen[friendship.FieldUserID]; !ok { selectedFields = append(selectedFields, friendship.FieldUserID) fieldSeen[friendship.FieldUserID] = struct{}{} @@ -460,12 +460,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withFriend = query + fq.withFriend = query if _, ok := fieldSeen[friendship.FieldFriendID]; !ok { selectedFields = append(selectedFields, friendship.FieldFriendID) fieldSeen[friendship.FieldFriendID] = struct{}{} @@ -492,7 +492,7 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - f.Select(selectedFields...) + fq.Select(selectedFields...) } return nil } @@ -527,18 +527,18 @@ func newFriendshipPaginateArgs(rv map[string]any) *friendshipPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { +func (gq *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return gr, nil + return gq, nil } - if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := gq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return gr, nil + return gq, nil } -func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (gq *GroupQuery) 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 @@ -552,7 +552,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: gr.config}).Query() + query = (&UserClient{config: gq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -570,7 +570,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - gr.loadTotal = append(gr.loadTotal, func(ctx context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(ctx context.Context, nodes []*Group) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -603,7 +603,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra return nil }) } else { - gr.loadTotal = append(gr.loadTotal, func(_ context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(_ context.Context, nodes []*Group) error { for i := range nodes { n := len(nodes[i].Edges.Users) if nodes[i].Edges.totalCount[0] == nil { @@ -637,7 +637,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } else { query = pager.applyOrder(query) } - gr.WithNamedUsers(alias, func(wq *UserQuery) { + gq.WithNamedUsers(alias, func(wq *UserQuery) { *wq = *query }) case "name": @@ -652,7 +652,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } } if !unknownSeen { - gr.Select(selectedFields...) + gq.Select(selectedFields...) } return nil } @@ -687,18 +687,18 @@ func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (otm *OneToManyQuery) CollectFields(ctx context.Context, satisfies ...string) (*OneToManyQuery, error) { +func (otmq *OneToManyQuery) CollectFields(ctx context.Context, satisfies ...string) (*OneToManyQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return otm, nil + return otmq, nil } - if err := otm.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := otmq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return otm, nil + return otmq, nil } -func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (otmq *OneToManyQuery) 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 @@ -712,12 +712,12 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&OneToManyClient{config: otm.config}).Query() + query = (&OneToManyClient{config: otmq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, onetomanyImplementors)...); err != nil { return err } - otm.withParent = query + otmq.withParent = query if _, ok := fieldSeen[onetomany.FieldParentID]; !ok { selectedFields = append(selectedFields, onetomany.FieldParentID) fieldSeen[onetomany.FieldParentID] = struct{}{} @@ -727,12 +727,12 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&OneToManyClient{config: otm.config}).Query() + query = (&OneToManyClient{config: otmq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, onetomanyImplementors)...); err != nil { return err } - otm.WithNamedChildren(alias, func(wq *OneToManyQuery) { + otmq.WithNamedChildren(alias, func(wq *OneToManyQuery) { *wq = *query }) case "name": @@ -752,7 +752,7 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - otm.Select(selectedFields...) + otmq.Select(selectedFields...) } return nil } @@ -809,18 +809,18 @@ func newOneToManyPaginateArgs(rv map[string]any) *onetomanyPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (pr *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error) { +func (pq *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return pr, nil + return pq, nil } - if err := pr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := pq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return pr, nil + return pq, nil } -func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (pq *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { path = append([]string(nil), path...) for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { switch field.Name { @@ -829,7 +829,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: pr.config}).Query() + query = (&TodoClient{config: pq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -847,7 +847,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - pr.loadTotal = append(pr.loadTotal, func(ctx context.Context, nodes []*Project) error { + pq.loadTotal = append(pq.loadTotal, func(ctx context.Context, nodes []*Project) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -876,7 +876,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - pr.loadTotal = append(pr.loadTotal, func(_ context.Context, nodes []*Project) error { + pq.loadTotal = append(pq.loadTotal, func(_ context.Context, nodes []*Project) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -910,7 +910,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - pr.WithNamedTodos(alias, func(wq *TodoQuery) { + pq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) } @@ -948,18 +948,18 @@ func newProjectPaginateArgs(rv map[string]any) *projectPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -973,18 +973,18 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1002,7 +1002,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - t.loadTotal = append(t.loadTotal, func(ctx context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(ctx context.Context, nodes []*Todo) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1031,7 +1031,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - t.loadTotal = append(t.loadTotal, func(_ context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(_ context.Context, nodes []*Todo) error { for i := range nodes { n := len(nodes[i].Edges.Children) if nodes[i].Edges.totalCount[1] == nil { @@ -1065,7 +1065,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -1073,12 +1073,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query if _, ok := fieldSeen[todo.FieldCategoryID]; !ok { selectedFields = append(selectedFields, todo.FieldCategoryID) fieldSeen[todo.FieldCategoryID] = struct{}{} @@ -1135,7 +1135,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } @@ -1198,18 +1198,18 @@ func newTodoPaginateArgs(rv map[string]any) *todoPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { +func (uq *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return u, nil + return uq, nil } - if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := uq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return u, nil + return uq, nil } -func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (uq *UserQuery) 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 @@ -1223,7 +1223,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&GroupClient{config: u.config}).Query() + query = (&GroupClient{config: uq.config}).Query() ) args := newGroupPaginateArgs(fieldArgs(ctx, new(GroupWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1241,7 +1241,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1274,7 +1274,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Groups) if nodes[i].Edges.totalCount[0] == nil { @@ -1308,7 +1308,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedGroups(alias, func(wq *GroupQuery) { + uq.WithNamedGroups(alias, func(wq *GroupQuery) { *wq = *query }) @@ -1316,7 +1316,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: u.config}).Query() + query = (&UserClient{config: uq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1334,7 +1334,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1367,7 +1367,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Friends) if nodes[i].Edges.totalCount[1] == nil { @@ -1401,7 +1401,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedFriends(alias, func(wq *UserQuery) { + uq.WithNamedFriends(alias, func(wq *UserQuery) { *wq = *query }) @@ -1409,7 +1409,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&FriendshipClient{config: u.config}).Query() + query = (&FriendshipClient{config: uq.config}).Query() ) args := newFriendshipPaginateArgs(fieldArgs(ctx, new(FriendshipWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1427,7 +1427,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1456,7 +1456,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Friendships) if nodes[i].Edges.totalCount[2] == nil { @@ -1490,7 +1490,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedFriendships(alias, func(wq *FriendshipQuery) { + uq.WithNamedFriendships(alias, func(wq *FriendshipQuery) { *wq = *query }) case "name": @@ -1520,7 +1520,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - u.Select(selectedFields...) + uq.Select(selectedFields...) } return nil } @@ -1577,18 +1577,18 @@ func newUserPaginateArgs(rv map[string]any) *userPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (w *WorkspaceQuery) CollectFields(ctx context.Context, satisfies ...string) (*WorkspaceQuery, error) { +func (wq *WorkspaceQuery) CollectFields(ctx context.Context, satisfies ...string) (*WorkspaceQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return w, nil + return wq, nil } - if err := w.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := wq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return w, nil + return wq, nil } -func (w *WorkspaceQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (wq *WorkspaceQuery) 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 @@ -1609,7 +1609,7 @@ func (w *WorkspaceQuery) collectField(ctx context.Context, oneNode bool, opCtx * } } if !unknownSeen { - w.Select(selectedFields...) + wq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todo/ent/runtime/runtime.go b/entgql/internal/todo/ent/runtime/runtime.go index 7aa3dd29d..439f3a03b 100644 --- a/entgql/internal/todo/ent/runtime/runtime.go +++ b/entgql/internal/todo/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todo/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entgql/internal/todofed/ent/gql_collection.go b/entgql/internal/todofed/ent/gql_collection.go index abefb433f..7e844f20e 100644 --- a/entgql/internal/todofed/ent/gql_collection.go +++ b/entgql/internal/todofed/ent/gql_collection.go @@ -26,18 +26,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -51,12 +51,12 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) case "text": @@ -96,7 +96,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -150,18 +150,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -175,23 +175,23 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -199,12 +199,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query case "createdAt": if _, ok := fieldSeen[todo.FieldCreatedAt]; !ok { selectedFields = append(selectedFields, todo.FieldCreatedAt) @@ -237,7 +237,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todofed/ent/runtime/runtime.go b/entgql/internal/todofed/ent/runtime/runtime.go index 24f6129af..44691c4d2 100644 --- a/entgql/internal/todofed/ent/runtime/runtime.go +++ b/entgql/internal/todofed/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todofed/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entgql/internal/todoglobalid/ent/gql_collection.go b/entgql/internal/todoglobalid/ent/gql_collection.go index 2cbd53e8e..be6822a99 100644 --- a/entgql/internal/todoglobalid/ent/gql_collection.go +++ b/entgql/internal/todoglobalid/ent/gql_collection.go @@ -36,18 +36,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { +func (bpq *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return bp, nil + return bpq, nil } - if err := bp.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := bpq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return bp, nil + return bpq, nil } -func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (bpq *BillProductQuery) 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 @@ -78,7 +78,7 @@ func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCt } } if !unknownSeen { - bp.Select(selectedFields...) + bpq.Select(selectedFields...) } return nil } @@ -113,18 +113,18 @@ func newBillProductPaginateArgs(rv map[string]any) *billproductPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -138,7 +138,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -156,7 +156,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -185,7 +185,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -219,7 +219,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) @@ -227,7 +227,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: c.config}).Query() + query = (&CategoryClient{config: cq.config}).Query() ) args := newCategoryPaginateArgs(fieldArgs(ctx, new(CategoryWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -245,7 +245,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -278,7 +278,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.SubCategories) if nodes[i].Edges.totalCount[1] == nil { @@ -312,7 +312,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedSubCategories(alias, func(wq *CategoryQuery) { + cq.WithNamedSubCategories(alias, func(wq *CategoryQuery) { *wq = *query }) case "text": @@ -357,7 +357,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -420,18 +420,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { +func (fq *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return f, nil + return fq, nil } - if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := fq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return f, nil + return fq, nil } -func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (fq *FriendshipQuery) 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 @@ -445,12 +445,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withUser = query + fq.withUser = query if _, ok := fieldSeen[friendship.FieldUserID]; !ok { selectedFields = append(selectedFields, friendship.FieldUserID) fieldSeen[friendship.FieldUserID] = struct{}{} @@ -460,12 +460,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withFriend = query + fq.withFriend = query if _, ok := fieldSeen[friendship.FieldFriendID]; !ok { selectedFields = append(selectedFields, friendship.FieldFriendID) fieldSeen[friendship.FieldFriendID] = struct{}{} @@ -492,7 +492,7 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - f.Select(selectedFields...) + fq.Select(selectedFields...) } return nil } @@ -527,18 +527,18 @@ func newFriendshipPaginateArgs(rv map[string]any) *friendshipPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { +func (gq *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return gr, nil + return gq, nil } - if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := gq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return gr, nil + return gq, nil } -func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (gq *GroupQuery) 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 @@ -552,7 +552,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: gr.config}).Query() + query = (&UserClient{config: gq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -570,7 +570,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - gr.loadTotal = append(gr.loadTotal, func(ctx context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(ctx context.Context, nodes []*Group) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -603,7 +603,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra return nil }) } else { - gr.loadTotal = append(gr.loadTotal, func(_ context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(_ context.Context, nodes []*Group) error { for i := range nodes { n := len(nodes[i].Edges.Users) if nodes[i].Edges.totalCount[0] == nil { @@ -637,7 +637,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } else { query = pager.applyOrder(query) } - gr.WithNamedUsers(alias, func(wq *UserQuery) { + gq.WithNamedUsers(alias, func(wq *UserQuery) { *wq = *query }) case "name": @@ -652,7 +652,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } } if !unknownSeen { - gr.Select(selectedFields...) + gq.Select(selectedFields...) } return nil } @@ -687,18 +687,18 @@ func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (otm *OneToManyQuery) CollectFields(ctx context.Context, satisfies ...string) (*OneToManyQuery, error) { +func (otmq *OneToManyQuery) CollectFields(ctx context.Context, satisfies ...string) (*OneToManyQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return otm, nil + return otmq, nil } - if err := otm.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := otmq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return otm, nil + return otmq, nil } -func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (otmq *OneToManyQuery) 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 @@ -712,12 +712,12 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&OneToManyClient{config: otm.config}).Query() + query = (&OneToManyClient{config: otmq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, onetomanyImplementors)...); err != nil { return err } - otm.withParent = query + otmq.withParent = query if _, ok := fieldSeen[onetomany.FieldParentID]; !ok { selectedFields = append(selectedFields, onetomany.FieldParentID) fieldSeen[onetomany.FieldParentID] = struct{}{} @@ -727,12 +727,12 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&OneToManyClient{config: otm.config}).Query() + query = (&OneToManyClient{config: otmq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, onetomanyImplementors)...); err != nil { return err } - otm.WithNamedChildren(alias, func(wq *OneToManyQuery) { + otmq.WithNamedChildren(alias, func(wq *OneToManyQuery) { *wq = *query }) case "name": @@ -752,7 +752,7 @@ func (otm *OneToManyQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - otm.Select(selectedFields...) + otmq.Select(selectedFields...) } return nil } @@ -809,18 +809,18 @@ func newOneToManyPaginateArgs(rv map[string]any) *onetomanyPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (pr *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error) { +func (pq *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return pr, nil + return pq, nil } - if err := pr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := pq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return pr, nil + return pq, nil } -func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (pq *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { path = append([]string(nil), path...) for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { switch field.Name { @@ -829,7 +829,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: pr.config}).Query() + query = (&TodoClient{config: pq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -847,7 +847,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - pr.loadTotal = append(pr.loadTotal, func(ctx context.Context, nodes []*Project) error { + pq.loadTotal = append(pq.loadTotal, func(ctx context.Context, nodes []*Project) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -876,7 +876,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - pr.loadTotal = append(pr.loadTotal, func(_ context.Context, nodes []*Project) error { + pq.loadTotal = append(pq.loadTotal, func(_ context.Context, nodes []*Project) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -910,7 +910,7 @@ func (pr *ProjectQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - pr.WithNamedTodos(alias, func(wq *TodoQuery) { + pq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) } @@ -948,18 +948,18 @@ func newProjectPaginateArgs(rv map[string]any) *projectPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -973,18 +973,18 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1002,7 +1002,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - t.loadTotal = append(t.loadTotal, func(ctx context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(ctx context.Context, nodes []*Todo) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1031,7 +1031,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - t.loadTotal = append(t.loadTotal, func(_ context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(_ context.Context, nodes []*Todo) error { for i := range nodes { n := len(nodes[i].Edges.Children) if nodes[i].Edges.totalCount[1] == nil { @@ -1065,7 +1065,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -1073,12 +1073,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query if _, ok := fieldSeen[todo.FieldCategoryID]; !ok { selectedFields = append(selectedFields, todo.FieldCategoryID) fieldSeen[todo.FieldCategoryID] = struct{}{} @@ -1135,7 +1135,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } @@ -1198,18 +1198,18 @@ func newTodoPaginateArgs(rv map[string]any) *todoPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { +func (uq *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return u, nil + return uq, nil } - if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := uq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return u, nil + return uq, nil } -func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (uq *UserQuery) 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 @@ -1223,7 +1223,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&GroupClient{config: u.config}).Query() + query = (&GroupClient{config: uq.config}).Query() ) args := newGroupPaginateArgs(fieldArgs(ctx, new(GroupWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1241,7 +1241,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1274,7 +1274,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Groups) if nodes[i].Edges.totalCount[0] == nil { @@ -1308,7 +1308,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedGroups(alias, func(wq *GroupQuery) { + uq.WithNamedGroups(alias, func(wq *GroupQuery) { *wq = *query }) @@ -1316,7 +1316,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: u.config}).Query() + query = (&UserClient{config: uq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1334,7 +1334,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1367,7 +1367,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Friends) if nodes[i].Edges.totalCount[1] == nil { @@ -1401,7 +1401,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedFriends(alias, func(wq *UserQuery) { + uq.WithNamedFriends(alias, func(wq *UserQuery) { *wq = *query }) @@ -1409,7 +1409,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&FriendshipClient{config: u.config}).Query() + query = (&FriendshipClient{config: uq.config}).Query() ) args := newFriendshipPaginateArgs(fieldArgs(ctx, new(FriendshipWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1427,7 +1427,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1456,7 +1456,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Friendships) if nodes[i].Edges.totalCount[2] == nil { @@ -1490,7 +1490,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedFriendships(alias, func(wq *FriendshipQuery) { + uq.WithNamedFriendships(alias, func(wq *FriendshipQuery) { *wq = *query }) case "name": @@ -1520,7 +1520,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - u.Select(selectedFields...) + uq.Select(selectedFields...) } return nil } @@ -1577,18 +1577,18 @@ func newUserPaginateArgs(rv map[string]any) *userPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (w *WorkspaceQuery) CollectFields(ctx context.Context, satisfies ...string) (*WorkspaceQuery, error) { +func (wq *WorkspaceQuery) CollectFields(ctx context.Context, satisfies ...string) (*WorkspaceQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return w, nil + return wq, nil } - if err := w.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := wq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return w, nil + return wq, nil } -func (w *WorkspaceQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (wq *WorkspaceQuery) 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 @@ -1609,7 +1609,7 @@ func (w *WorkspaceQuery) collectField(ctx context.Context, oneNode bool, opCtx * } } if !unknownSeen { - w.Select(selectedFields...) + wq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todoglobalid/ent/migrate/schema.go b/entgql/internal/todoglobalid/ent/migrate/schema.go index 9caac9e96..3aca89940 100644 --- a/entgql/internal/todoglobalid/ent/migrate/schema.go +++ b/entgql/internal/todoglobalid/ent/migrate/schema.go @@ -284,41 +284,41 @@ var ( func init() { BillProductsTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(0), + IncrementStart: func(i int) *int { return &i }(0), } CategoriesTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(4294967296), + IncrementStart: func(i int) *int { return &i }(4294967296), } FriendshipsTable.ForeignKeys[0].RefTable = UsersTable FriendshipsTable.ForeignKeys[1].RefTable = UsersTable FriendshipsTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(8589934592), + IncrementStart: func(i int) *int { return &i }(8589934592), } GroupsTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(12884901888), + IncrementStart: func(i int) *int { return &i }(12884901888), } OneToManiesTable.ForeignKeys[0].RefTable = OneToManiesTable OneToManiesTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(17179869184), + IncrementStart: func(i int) *int { return &i }(17179869184), } ProjectsTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(21474836480), + IncrementStart: func(i int) *int { return &i }(21474836480), } TodosTable.ForeignKeys[0].RefTable = CategoriesTable TodosTable.ForeignKeys[1].RefTable = ProjectsTable TodosTable.ForeignKeys[2].RefTable = TodosTable TodosTable.ForeignKeys[3].RefTable = VerySecretsTable TodosTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(25769803776), + IncrementStart: func(i int) *int { return &i }(25769803776), } UsersTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(30064771072), + IncrementStart: func(i int) *int { return &i }(30064771072), } VerySecretsTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(34359738368), + IncrementStart: func(i int) *int { return &i }(34359738368), } WorkspacesTable.Annotation = &entsql.Annotation{ - IncrementStart: func(i int64) *int64 { return &i }(38654705664), + IncrementStart: func(i int) *int { return &i }(38654705664), } CategorySubCategoriesTable.ForeignKeys[0].RefTable = CategoriesTable CategorySubCategoriesTable.ForeignKeys[1].RefTable = CategoriesTable diff --git a/entgql/internal/todoglobalid/ent/runtime/runtime.go b/entgql/internal/todoglobalid/ent/runtime/runtime.go index 3f014ef2b..8054d01d2 100644 --- a/entgql/internal/todoglobalid/ent/runtime/runtime.go +++ b/entgql/internal/todoglobalid/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todoglobalid/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entgql/internal/todogotype/ent/gql_collection.go b/entgql/internal/todogotype/ent/gql_collection.go index f9518f710..c83416444 100644 --- a/entgql/internal/todogotype/ent/gql_collection.go +++ b/entgql/internal/todogotype/ent/gql_collection.go @@ -35,18 +35,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { +func (bpq *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return bp, nil + return bpq, nil } - if err := bp.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := bpq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return bp, nil + return bpq, nil } -func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (bpq *BillProductQuery) 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 @@ -77,7 +77,7 @@ func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCt } } if !unknownSeen { - bp.Select(selectedFields...) + bpq.Select(selectedFields...) } return nil } @@ -112,18 +112,18 @@ func newBillProductPaginateArgs(rv map[string]any) *billproductPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -137,7 +137,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -155,7 +155,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -184,7 +184,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -218,7 +218,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) @@ -226,7 +226,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: c.config}).Query() + query = (&CategoryClient{config: cq.config}).Query() ) args := newCategoryPaginateArgs(fieldArgs(ctx, new(CategoryWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -244,7 +244,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -277,7 +277,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.SubCategories) if nodes[i].Edges.totalCount[1] == nil { @@ -311,7 +311,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedSubCategories(alias, func(wq *CategoryQuery) { + cq.WithNamedSubCategories(alias, func(wq *CategoryQuery) { *wq = *query }) case "text": @@ -356,7 +356,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -419,18 +419,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { +func (fq *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return f, nil + return fq, nil } - if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := fq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return f, nil + return fq, nil } -func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (fq *FriendshipQuery) 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 @@ -444,12 +444,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withUser = query + fq.withUser = query if _, ok := fieldSeen[friendship.FieldUserID]; !ok { selectedFields = append(selectedFields, friendship.FieldUserID) fieldSeen[friendship.FieldUserID] = struct{}{} @@ -459,12 +459,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withFriend = query + fq.withFriend = query if _, ok := fieldSeen[friendship.FieldFriendID]; !ok { selectedFields = append(selectedFields, friendship.FieldFriendID) fieldSeen[friendship.FieldFriendID] = struct{}{} @@ -491,7 +491,7 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - f.Select(selectedFields...) + fq.Select(selectedFields...) } return nil } @@ -526,18 +526,18 @@ func newFriendshipPaginateArgs(rv map[string]any) *friendshipPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { +func (gq *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return gr, nil + return gq, nil } - if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := gq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return gr, nil + return gq, nil } -func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (gq *GroupQuery) 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 @@ -551,7 +551,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: gr.config}).Query() + query = (&UserClient{config: gq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -569,7 +569,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - gr.loadTotal = append(gr.loadTotal, func(ctx context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(ctx context.Context, nodes []*Group) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -602,7 +602,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra return nil }) } else { - gr.loadTotal = append(gr.loadTotal, func(_ context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(_ context.Context, nodes []*Group) error { for i := range nodes { n := len(nodes[i].Edges.Users) if nodes[i].Edges.totalCount[0] == nil { @@ -636,7 +636,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } else { query = pager.applyOrder(query) } - gr.WithNamedUsers(alias, func(wq *UserQuery) { + gq.WithNamedUsers(alias, func(wq *UserQuery) { *wq = *query }) case "name": @@ -651,7 +651,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } } if !unknownSeen { - gr.Select(selectedFields...) + gq.Select(selectedFields...) } return nil } @@ -686,18 +686,18 @@ func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (pe *PetQuery) CollectFields(ctx context.Context, satisfies ...string) (*PetQuery, error) { +func (pq *PetQuery) CollectFields(ctx context.Context, satisfies ...string) (*PetQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return pe, nil + return pq, nil } - if err := pe.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := pq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return pe, nil + return pq, nil } -func (pe *PetQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (pq *PetQuery) 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 @@ -718,7 +718,7 @@ func (pe *PetQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - pe.Select(selectedFields...) + pq.Select(selectedFields...) } return nil } @@ -753,18 +753,18 @@ func newPetPaginateArgs(rv map[string]any) *petPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -778,18 +778,18 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -807,7 +807,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - t.loadTotal = append(t.loadTotal, func(ctx context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(ctx context.Context, nodes []*Todo) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -836,7 +836,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - t.loadTotal = append(t.loadTotal, func(_ context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(_ context.Context, nodes []*Todo) error { for i := range nodes { n := len(nodes[i].Edges.Children) if nodes[i].Edges.totalCount[1] == nil { @@ -870,7 +870,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -878,12 +878,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query if _, ok := fieldSeen[todo.FieldCategoryID]; !ok { selectedFields = append(selectedFields, todo.FieldCategoryID) fieldSeen[todo.FieldCategoryID] = struct{}{} @@ -940,7 +940,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } @@ -1003,18 +1003,18 @@ func newTodoPaginateArgs(rv map[string]any) *todoPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { +func (uq *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return u, nil + return uq, nil } - if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := uq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return u, nil + return uq, nil } -func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (uq *UserQuery) 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 @@ -1028,7 +1028,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&GroupClient{config: u.config}).Query() + query = (&GroupClient{config: uq.config}).Query() ) args := newGroupPaginateArgs(fieldArgs(ctx, new(GroupWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -1046,7 +1046,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1079,7 +1079,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Groups) if nodes[i].Edges.totalCount[0] == nil { @@ -1113,7 +1113,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedGroups(alias, func(wq *GroupQuery) { + uq.WithNamedGroups(alias, func(wq *GroupQuery) { *wq = *query }) @@ -1121,12 +1121,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: u.config}).Query() + query = (&UserClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - u.WithNamedFriends(alias, func(wq *UserQuery) { + uq.WithNamedFriends(alias, func(wq *UserQuery) { *wq = *query }) @@ -1134,12 +1134,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&FriendshipClient{config: u.config}).Query() + query = (&FriendshipClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, friendshipImplementors)...); err != nil { return err } - u.WithNamedFriendships(alias, func(wq *FriendshipQuery) { + uq.WithNamedFriendships(alias, func(wq *FriendshipQuery) { *wq = *query }) case "name": @@ -1154,7 +1154,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - u.Select(selectedFields...) + uq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todogotype/ent/runtime/runtime.go b/entgql/internal/todogotype/ent/runtime/runtime.go index a89a1ef4f..584cfe6d7 100644 --- a/entgql/internal/todogotype/ent/runtime/runtime.go +++ b/entgql/internal/todogotype/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todogotype/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entgql/internal/todogotype/generated.go b/entgql/internal/todogotype/generated.go index 0e24fdf15..76712c91a 100644 --- a/entgql/internal/todogotype/generated.go +++ b/entgql/internal/todogotype/generated.go @@ -20258,7 +20258,7 @@ func (ec *executionContext) marshalOInt2áš–int(ctx context.Context, sel ast.Sele return res } -func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v any) (map[string]interface{}, error) { +func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v any) (map[string]any, error) { if v == nil { return nil, nil } @@ -20266,7 +20266,7 @@ func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v any) (map[s return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]any) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/entgql/internal/todopulid/ent/gql_collection.go b/entgql/internal/todopulid/ent/gql_collection.go index 37687b177..22d5fdf20 100644 --- a/entgql/internal/todopulid/ent/gql_collection.go +++ b/entgql/internal/todopulid/ent/gql_collection.go @@ -34,18 +34,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { +func (bpq *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return bp, nil + return bpq, nil } - if err := bp.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := bpq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return bp, nil + return bpq, nil } -func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (bpq *BillProductQuery) 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 @@ -76,7 +76,7 @@ func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCt } } if !unknownSeen { - bp.Select(selectedFields...) + bpq.Select(selectedFields...) } return nil } @@ -111,18 +111,18 @@ func newBillProductPaginateArgs(rv map[string]any) *billproductPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -136,7 +136,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -154,7 +154,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -183,7 +183,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -217,7 +217,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) @@ -225,7 +225,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: c.config}).Query() + query = (&CategoryClient{config: cq.config}).Query() ) args := newCategoryPaginateArgs(fieldArgs(ctx, new(CategoryWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -243,7 +243,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -276,7 +276,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.SubCategories) if nodes[i].Edges.totalCount[1] == nil { @@ -310,7 +310,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedSubCategories(alias, func(wq *CategoryQuery) { + cq.WithNamedSubCategories(alias, func(wq *CategoryQuery) { *wq = *query }) case "text": @@ -355,7 +355,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -418,18 +418,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { +func (fq *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return f, nil + return fq, nil } - if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := fq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return f, nil + return fq, nil } -func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (fq *FriendshipQuery) 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 @@ -443,12 +443,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withUser = query + fq.withUser = query if _, ok := fieldSeen[friendship.FieldUserID]; !ok { selectedFields = append(selectedFields, friendship.FieldUserID) fieldSeen[friendship.FieldUserID] = struct{}{} @@ -458,12 +458,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withFriend = query + fq.withFriend = query if _, ok := fieldSeen[friendship.FieldFriendID]; !ok { selectedFields = append(selectedFields, friendship.FieldFriendID) fieldSeen[friendship.FieldFriendID] = struct{}{} @@ -490,7 +490,7 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - f.Select(selectedFields...) + fq.Select(selectedFields...) } return nil } @@ -525,18 +525,18 @@ func newFriendshipPaginateArgs(rv map[string]any) *friendshipPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { +func (gq *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return gr, nil + return gq, nil } - if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := gq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return gr, nil + return gq, nil } -func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (gq *GroupQuery) 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 @@ -550,7 +550,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: gr.config}).Query() + query = (&UserClient{config: gq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -568,7 +568,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - gr.loadTotal = append(gr.loadTotal, func(ctx context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(ctx context.Context, nodes []*Group) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -601,7 +601,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra return nil }) } else { - gr.loadTotal = append(gr.loadTotal, func(_ context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(_ context.Context, nodes []*Group) error { for i := range nodes { n := len(nodes[i].Edges.Users) if nodes[i].Edges.totalCount[0] == nil { @@ -635,7 +635,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } else { query = pager.applyOrder(query) } - gr.WithNamedUsers(alias, func(wq *UserQuery) { + gq.WithNamedUsers(alias, func(wq *UserQuery) { *wq = *query }) case "name": @@ -650,7 +650,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } } if !unknownSeen { - gr.Select(selectedFields...) + gq.Select(selectedFields...) } return nil } @@ -685,18 +685,18 @@ func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -710,18 +710,18 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -739,7 +739,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - t.loadTotal = append(t.loadTotal, func(ctx context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(ctx context.Context, nodes []*Todo) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -768,7 +768,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - t.loadTotal = append(t.loadTotal, func(_ context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(_ context.Context, nodes []*Todo) error { for i := range nodes { n := len(nodes[i].Edges.Children) if nodes[i].Edges.totalCount[1] == nil { @@ -802,7 +802,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -810,12 +810,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query if _, ok := fieldSeen[todo.FieldCategoryID]; !ok { selectedFields = append(selectedFields, todo.FieldCategoryID) fieldSeen[todo.FieldCategoryID] = struct{}{} @@ -872,7 +872,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } @@ -935,18 +935,18 @@ func newTodoPaginateArgs(rv map[string]any) *todoPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { +func (uq *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return u, nil + return uq, nil } - if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := uq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return u, nil + return uq, nil } -func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (uq *UserQuery) 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 @@ -960,7 +960,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&GroupClient{config: u.config}).Query() + query = (&GroupClient{config: uq.config}).Query() ) args := newGroupPaginateArgs(fieldArgs(ctx, new(GroupWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -978,7 +978,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1011,7 +1011,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Groups) if nodes[i].Edges.totalCount[0] == nil { @@ -1045,7 +1045,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedGroups(alias, func(wq *GroupQuery) { + uq.WithNamedGroups(alias, func(wq *GroupQuery) { *wq = *query }) @@ -1053,12 +1053,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: u.config}).Query() + query = (&UserClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - u.WithNamedFriends(alias, func(wq *UserQuery) { + uq.WithNamedFriends(alias, func(wq *UserQuery) { *wq = *query }) @@ -1066,12 +1066,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&FriendshipClient{config: u.config}).Query() + query = (&FriendshipClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, friendshipImplementors)...); err != nil { return err } - u.WithNamedFriendships(alias, func(wq *FriendshipQuery) { + uq.WithNamedFriendships(alias, func(wq *FriendshipQuery) { *wq = *query }) case "name": @@ -1101,7 +1101,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - u.Select(selectedFields...) + uq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todopulid/ent/runtime/runtime.go b/entgql/internal/todopulid/ent/runtime/runtime.go index f989840ab..75e69f9bd 100644 --- a/entgql/internal/todopulid/ent/runtime/runtime.go +++ b/entgql/internal/todopulid/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todopulid/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entgql/internal/todouuid/ent/gql_collection.go b/entgql/internal/todouuid/ent/gql_collection.go index 80e24f34d..31967c7e5 100644 --- a/entgql/internal/todouuid/ent/gql_collection.go +++ b/entgql/internal/todouuid/ent/gql_collection.go @@ -34,18 +34,18 @@ import ( ) // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { +func (bpq *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return bp, nil + return bpq, nil } - if err := bp.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := bpq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return bp, nil + return bpq, nil } -func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (bpq *BillProductQuery) 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 @@ -76,7 +76,7 @@ func (bp *BillProductQuery) collectField(ctx context.Context, oneNode bool, opCt } } if !unknownSeen { - bp.Select(selectedFields...) + bpq.Select(selectedFields...) } return nil } @@ -111,18 +111,18 @@ func newBillProductPaginateArgs(rv map[string]any) *billproductPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { +func (cq *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return c, nil + return cq, nil } - if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := cq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return c, nil + return cq, nil } -func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (cq *CategoryQuery) 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 @@ -136,7 +136,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: c.config}).Query() + query = (&TodoClient{config: cq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -154,7 +154,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -183,7 +183,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.Todos) if nodes[i].Edges.totalCount[0] == nil { @@ -217,7 +217,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedTodos(alias, func(wq *TodoQuery) { + cq.WithNamedTodos(alias, func(wq *TodoQuery) { *wq = *query }) @@ -225,7 +225,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: c.config}).Query() + query = (&CategoryClient{config: cq.config}).Query() ) args := newCategoryPaginateArgs(fieldArgs(ctx, new(CategoryWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -243,7 +243,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - c.loadTotal = append(c.loadTotal, func(ctx context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(ctx context.Context, nodes []*Category) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -276,7 +276,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g return nil }) } else { - c.loadTotal = append(c.loadTotal, func(_ context.Context, nodes []*Category) error { + cq.loadTotal = append(cq.loadTotal, func(_ context.Context, nodes []*Category) error { for i := range nodes { n := len(nodes[i].Edges.SubCategories) if nodes[i].Edges.totalCount[1] == nil { @@ -310,7 +310,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } else { query = pager.applyOrder(query) } - c.WithNamedSubCategories(alias, func(wq *CategoryQuery) { + cq.WithNamedSubCategories(alias, func(wq *CategoryQuery) { *wq = *query }) case "text": @@ -355,7 +355,7 @@ func (c *CategoryQuery) collectField(ctx context.Context, oneNode bool, opCtx *g } } if !unknownSeen { - c.Select(selectedFields...) + cq.Select(selectedFields...) } return nil } @@ -418,18 +418,18 @@ func newCategoryPaginateArgs(rv map[string]any) *categoryPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { +func (fq *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return f, nil + return fq, nil } - if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := fq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return f, nil + return fq, nil } -func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (fq *FriendshipQuery) 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 @@ -443,12 +443,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withUser = query + fq.withUser = query if _, ok := fieldSeen[friendship.FieldUserID]; !ok { selectedFields = append(selectedFields, friendship.FieldUserID) fieldSeen[friendship.FieldUserID] = struct{}{} @@ -458,12 +458,12 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: f.config}).Query() + query = (&UserClient{config: fq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - f.withFriend = query + fq.withFriend = query if _, ok := fieldSeen[friendship.FieldFriendID]; !ok { selectedFields = append(selectedFields, friendship.FieldFriendID) fieldSeen[friendship.FieldFriendID] = struct{}{} @@ -490,7 +490,7 @@ func (f *FriendshipQuery) collectField(ctx context.Context, oneNode bool, opCtx } } if !unknownSeen { - f.Select(selectedFields...) + fq.Select(selectedFields...) } return nil } @@ -525,18 +525,18 @@ func newFriendshipPaginateArgs(rv map[string]any) *friendshipPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { +func (gq *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return gr, nil + return gq, nil } - if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := gq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return gr, nil + return gq, nil } -func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (gq *GroupQuery) 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 @@ -550,7 +550,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: gr.config}).Query() + query = (&UserClient{config: gq.config}).Query() ) args := newUserPaginateArgs(fieldArgs(ctx, new(UserWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -568,7 +568,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - gr.loadTotal = append(gr.loadTotal, func(ctx context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(ctx context.Context, nodes []*Group) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -601,7 +601,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra return nil }) } else { - gr.loadTotal = append(gr.loadTotal, func(_ context.Context, nodes []*Group) error { + gq.loadTotal = append(gq.loadTotal, func(_ context.Context, nodes []*Group) error { for i := range nodes { n := len(nodes[i].Edges.Users) if nodes[i].Edges.totalCount[0] == nil { @@ -635,7 +635,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } else { query = pager.applyOrder(query) } - gr.WithNamedUsers(alias, func(wq *UserQuery) { + gq.WithNamedUsers(alias, func(wq *UserQuery) { *wq = *query }) case "name": @@ -650,7 +650,7 @@ func (gr *GroupQuery) collectField(ctx context.Context, oneNode bool, opCtx *gra } } if !unknownSeen { - gr.Select(selectedFields...) + gq.Select(selectedFields...) } return nil } @@ -685,18 +685,18 @@ func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { +func (tq *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return t, nil + return tq, nil } - if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := tq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return t, nil + return tq, nil } -func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (tq *TodoQuery) 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 @@ -710,18 +710,18 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, todoImplementors)...); err != nil { return err } - t.withParent = query + tq.withParent = query case "children": var ( alias = field.Alias path = append(path, alias) - query = (&TodoClient{config: t.config}).Query() + query = (&TodoClient{config: tq.config}).Query() ) args := newTodoPaginateArgs(fieldArgs(ctx, new(TodoWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -739,7 +739,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - t.loadTotal = append(t.loadTotal, func(ctx context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(ctx context.Context, nodes []*Todo) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -768,7 +768,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - t.loadTotal = append(t.loadTotal, func(_ context.Context, nodes []*Todo) error { + tq.loadTotal = append(tq.loadTotal, func(_ context.Context, nodes []*Todo) error { for i := range nodes { n := len(nodes[i].Edges.Children) if nodes[i].Edges.totalCount[1] == nil { @@ -802,7 +802,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - t.WithNamedChildren(alias, func(wq *TodoQuery) { + tq.WithNamedChildren(alias, func(wq *TodoQuery) { *wq = *query }) @@ -810,12 +810,12 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&CategoryClient{config: t.config}).Query() + query = (&CategoryClient{config: tq.config}).Query() ) if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, categoryImplementors)...); err != nil { return err } - t.withCategory = query + tq.withCategory = query if _, ok := fieldSeen[todo.FieldCategoryID]; !ok { selectedFields = append(selectedFields, todo.FieldCategoryID) fieldSeen[todo.FieldCategoryID] = struct{}{} @@ -872,7 +872,7 @@ func (t *TodoQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - t.Select(selectedFields...) + tq.Select(selectedFields...) } return nil } @@ -935,18 +935,18 @@ func newTodoPaginateArgs(rv map[string]any) *todoPaginateArgs { } // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. -func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { +func (uq *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { fc := graphql.GetFieldContext(ctx) if fc == nil { - return u, nil + return uq, nil } - if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := uq.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { return nil, err } - return u, nil + return uq, nil } -func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graphql.OperationContext, collected graphql.CollectedField, path []string, satisfies ...string) error { +func (uq *UserQuery) 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 @@ -960,7 +960,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&GroupClient{config: u.config}).Query() + query = (&GroupClient{config: uq.config}).Query() ) args := newGroupPaginateArgs(fieldArgs(ctx, new(GroupWhereInput), path...)) if err := validateFirstLast(args.first, args.last); err != nil { @@ -978,7 +978,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil if hasPagination || ignoredEdges { query := query.Clone() - u.loadTotal = append(u.loadTotal, func(ctx context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(ctx context.Context, nodes []*User) error { ids := make([]driver.Value, len(nodes)) for i := range nodes { ids[i] = nodes[i].ID @@ -1011,7 +1011,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph return nil }) } else { - u.loadTotal = append(u.loadTotal, func(_ context.Context, nodes []*User) error { + uq.loadTotal = append(uq.loadTotal, func(_ context.Context, nodes []*User) error { for i := range nodes { n := len(nodes[i].Edges.Groups) if nodes[i].Edges.totalCount[0] == nil { @@ -1045,7 +1045,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } else { query = pager.applyOrder(query) } - u.WithNamedGroups(alias, func(wq *GroupQuery) { + uq.WithNamedGroups(alias, func(wq *GroupQuery) { *wq = *query }) @@ -1053,12 +1053,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&UserClient{config: u.config}).Query() + query = (&UserClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { return err } - u.WithNamedFriends(alias, func(wq *UserQuery) { + uq.WithNamedFriends(alias, func(wq *UserQuery) { *wq = *query }) @@ -1066,12 +1066,12 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph var ( alias = field.Alias path = append(path, alias) - query = (&FriendshipClient{config: u.config}).Query() + query = (&FriendshipClient{config: uq.config}).Query() ) if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, friendshipImplementors)...); err != nil { return err } - u.WithNamedFriendships(alias, func(wq *FriendshipQuery) { + uq.WithNamedFriendships(alias, func(wq *FriendshipQuery) { *wq = *query }) case "name": @@ -1101,7 +1101,7 @@ func (u *UserQuery) collectField(ctx context.Context, oneNode bool, opCtx *graph } } if !unknownSeen { - u.Select(selectedFields...) + uq.Select(selectedFields...) } return nil } diff --git a/entgql/internal/todouuid/ent/runtime/runtime.go b/entgql/internal/todouuid/ent/runtime/runtime.go index 09382a1f6..556f5692a 100644 --- a/entgql/internal/todouuid/ent/runtime/runtime.go +++ b/entgql/internal/todouuid/ent/runtime/runtime.go @@ -19,6 +19,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entgql/internal/todouuid/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) From 3b576487268654d9a4fb5816314f8ed52508e0d4 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:20:34 +0700 Subject: [PATCH 3/6] entoas: codegen --- entoas/internal/cycle/runtime/runtime.go | 4 ++-- entoas/internal/oastypes/runtime/runtime.go | 4 ++-- entoas/internal/pets/runtime/runtime.go | 4 ++-- entoas/internal/simple/runtime/runtime.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/entoas/internal/cycle/runtime/runtime.go b/entoas/internal/cycle/runtime/runtime.go index 07166e876..6ee62dd55 100644 --- a/entoas/internal/cycle/runtime/runtime.go +++ b/entoas/internal/cycle/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entoas/internal/cycle/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entoas/internal/oastypes/runtime/runtime.go b/entoas/internal/oastypes/runtime/runtime.go index 461473126..d78e3fa14 100644 --- a/entoas/internal/oastypes/runtime/runtime.go +++ b/entoas/internal/oastypes/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entoas/internal/oastypes/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entoas/internal/pets/runtime/runtime.go b/entoas/internal/pets/runtime/runtime.go index dd9d8a100..c5a2b3212 100644 --- a/entoas/internal/pets/runtime/runtime.go +++ b/entoas/internal/pets/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entoas/internal/pets/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entoas/internal/simple/runtime/runtime.go b/entoas/internal/simple/runtime/runtime.go index eb022571b..7a08f4dcf 100644 --- a/entoas/internal/simple/runtime/runtime.go +++ b/entoas/internal/simple/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entoas/internal/simple/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) From 02dd84a8aab8edb9346ff960e74c335a9f4b4baa Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:28:16 +0700 Subject: [PATCH 4/6] entproto: codegen --- entproto/README.md | 6 ++---- .../cmd/protoc-gen-ent/internal/todo/ent/runtime/runtime.go | 4 ++-- entproto/internal/altdir/ent/runtime/runtime.go | 4 ++-- entproto/internal/bare/ent/runtime/runtime.go | 4 ++-- entproto/internal/entprototest/ent/runtime/runtime.go | 4 ++-- entproto/internal/todo/ent/runtime/runtime.go | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/entproto/README.md b/entproto/README.md index 418234b02..1a901ebf1 100644 --- a/entproto/README.md +++ b/entproto/README.md @@ -505,16 +505,14 @@ can use the provided [Dockerfile](Dockerfile) that mimics the CI environment. Build the image: ```shell -cd entproto -docker build `--platform=linux/x86_64` -t entproto-dev . -cd .. +docker build --platform='linux/x86_64' -f entproto/Dockerfile -t entproto-dev:latest . ``` Run the image (from the root `contrib/` directory), mounting your local source code into `/go/src` inside the container: ```shell -docker run --platform=linux/x86_64 -it -v $(pwd):/go/src -w /go/src/entproto entproto-dev bash +docker run --platform='linux/x86_64' -it -v $(pwd):/go/src -w /go/src/entproto entproto-dev bash ``` From within the Docker image, compile and install your current `protoc-gen-entgrpc` diff --git a/entproto/cmd/protoc-gen-ent/internal/todo/ent/runtime/runtime.go b/entproto/cmd/protoc-gen-ent/internal/todo/ent/runtime/runtime.go index 663d9f9be..edc73edca 100644 --- a/entproto/cmd/protoc-gen-ent/internal/todo/ent/runtime/runtime.go +++ b/entproto/cmd/protoc-gen-ent/internal/todo/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entproto/cmd/protoc-gen-ent/internal/todo/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entproto/internal/altdir/ent/runtime/runtime.go b/entproto/internal/altdir/ent/runtime/runtime.go index ce01bee48..1a3faee92 100644 --- a/entproto/internal/altdir/ent/runtime/runtime.go +++ b/entproto/internal/altdir/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entproto/internal/altdir/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entproto/internal/bare/ent/runtime/runtime.go b/entproto/internal/bare/ent/runtime/runtime.go index 34e66fba9..f087be647 100644 --- a/entproto/internal/bare/ent/runtime/runtime.go +++ b/entproto/internal/bare/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entproto/internal/bare/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entproto/internal/entprototest/ent/runtime/runtime.go b/entproto/internal/entprototest/ent/runtime/runtime.go index 67c95388d..1e5052ac3 100644 --- a/entproto/internal/entprototest/ent/runtime/runtime.go +++ b/entproto/internal/entprototest/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entproto/internal/entprototest/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/entproto/internal/todo/ent/runtime/runtime.go b/entproto/internal/todo/ent/runtime/runtime.go index 29eff6799..34b0631bb 100644 --- a/entproto/internal/todo/ent/runtime/runtime.go +++ b/entproto/internal/todo/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/entproto/internal/todo/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) From 35c39053b3817d04f985973efd6c16c5ce039206 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:32:54 +0700 Subject: [PATCH 5/6] schemast: codegen --- schemast/internal/loadtest/ent/runtime/runtime.go | 4 ++-- schemast/internal/mutatetest/ent/runtime/runtime.go | 4 ++-- schemast/internal/printtest/ent/runtime/runtime.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/schemast/internal/loadtest/ent/runtime/runtime.go b/schemast/internal/loadtest/ent/runtime/runtime.go index 501ac8938..1fe8047f6 100644 --- a/schemast/internal/loadtest/ent/runtime/runtime.go +++ b/schemast/internal/loadtest/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/schemast/internal/loadtest/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/schemast/internal/mutatetest/ent/runtime/runtime.go b/schemast/internal/mutatetest/ent/runtime/runtime.go index 3675610e7..d118c1322 100644 --- a/schemast/internal/mutatetest/ent/runtime/runtime.go +++ b/schemast/internal/mutatetest/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/schemast/internal/mutatetest/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) diff --git a/schemast/internal/printtest/ent/runtime/runtime.go b/schemast/internal/printtest/ent/runtime/runtime.go index c13d4a08d..3bd0b0513 100644 --- a/schemast/internal/printtest/ent/runtime/runtime.go +++ b/schemast/internal/printtest/ent/runtime/runtime.go @@ -5,6 +5,6 @@ package runtime // The schema-stitching logic is generated in entgo.io/contrib/schemast/internal/printtest/ent/runtime.go const ( - Version = "v0.14.2-0.20250116103911-b91f8daf0e32" // Version of ent codegen. - Sum = "h1:caGPxY54QfxAj6W9Msw3vgOPDved92NoZjHXYiTRFHI=" // Sum of ent codegen. + Version = "v0.14.4" // Version of ent codegen. + Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. ) From a4a55416e0e121be482fb868a8f46db25a755335 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Wed, 19 Mar 2025 12:39:10 +0700 Subject: [PATCH 6/6] .github/workflows: update ci.yml workflow --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c22bf9367..4dea6511a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.23 + go-version-file: go.mod - name: Run linters uses: golangci/golangci-lint-action@v6.1.1 with: @@ -25,10 +25,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ['1.22', '1.23'] + go: ['1.23', '1.24'] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - uses: actions/cache@v3 @@ -44,11 +44,11 @@ jobs: generate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.23' - - uses: actions/cache@v3 + go-version-file: go.mod + - uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}