diff --git a/_examples/config/schema.resolvers.go b/_examples/config/schema.resolvers.go index 8636689f1d8..1107d5b01e0 100644 --- a/_examples/config/schema.resolvers.go +++ b/_examples/config/schema.resolvers.go @@ -2,7 +2,7 @@ package config // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/config/todo.resolvers.go b/_examples/config/todo.resolvers.go index 46405fcdd86..b532307c853 100644 --- a/_examples/config/todo.resolvers.go +++ b/_examples/config/todo.resolvers.go @@ -2,7 +2,7 @@ package config // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/config/user.resolvers.go b/_examples/config/user.resolvers.go index a8a8c0622c2..539be792bab 100644 --- a/_examples/config/user.resolvers.go +++ b/_examples/config/user.resolvers.go @@ -2,7 +2,7 @@ package config // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/enum/api/enum.go b/_examples/enum/api/enum.go index c53d8159f51..8844f565ec4 100644 --- a/_examples/enum/api/enum.go +++ b/_examples/enum/api/enum.go @@ -2,7 +2,7 @@ package api // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/accounts/graph/entity.resolvers.go b/_examples/federation/accounts/graph/entity.resolvers.go index f9e85af907a..837c94ecdbb 100644 --- a/_examples/federation/accounts/graph/entity.resolvers.go +++ b/_examples/federation/accounts/graph/entity.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/accounts/graph/schema.resolvers.go b/_examples/federation/accounts/graph/schema.resolvers.go index 92388bffd58..5b1c653f499 100644 --- a/_examples/federation/accounts/graph/schema.resolvers.go +++ b/_examples/federation/accounts/graph/schema.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/products/graph/entity.resolvers.go b/_examples/federation/products/graph/entity.resolvers.go index 9328f2e50a1..c33ac00febd 100644 --- a/_examples/federation/products/graph/entity.resolvers.go +++ b/_examples/federation/products/graph/entity.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/products/graph/schema.resolvers.go b/_examples/federation/products/graph/schema.resolvers.go index 6d36ad434c5..dd7f78b40f1 100644 --- a/_examples/federation/products/graph/schema.resolvers.go +++ b/_examples/federation/products/graph/schema.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/reviews/graph/entity.resolvers.go b/_examples/federation/reviews/graph/entity.resolvers.go index 70d97df2cc3..882c508f0df 100644 --- a/_examples/federation/reviews/graph/entity.resolvers.go +++ b/_examples/federation/reviews/graph/entity.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/federation/reviews/graph/schema.resolvers.go b/_examples/federation/reviews/graph/schema.resolvers.go index 50c9d6f3fd8..d9cd8f8fa33 100644 --- a/_examples/federation/reviews/graph/schema.resolvers.go +++ b/_examples/federation/reviews/graph/schema.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/_examples/go.mod b/_examples/go.mod index 4a98536f990..e77c6652a0d 100644 --- a/_examples/go.mod +++ b/_examples/go.mod @@ -12,7 +12,7 @@ require ( github.com/rs/cors v1.11.0 github.com/stretchr/testify v1.9.0 github.com/vektah/dataloaden v0.3.0 - github.com/vektah/gqlparser/v2 v2.5.11 + github.com/vektah/gqlparser/v2 v2.5.12 ) require ( diff --git a/_examples/go.sum b/_examples/go.sum index b911df40a40..55041abc03e 100644 --- a/_examples/go.sum +++ b/_examples/go.sum @@ -40,8 +40,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/vektah/dataloaden v0.3.0 h1:ZfVN2QD6swgvp+tDqdH/OIT/wu3Dhu0cus0k5gIZS84= github.com/vektah/dataloaden v0.3.0/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= -github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= -github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= +github.com/vektah/gqlparser/v2 v2.5.12 h1:COMhVVnql6RoaF7+aTBWiTADdpLGyZWU3K/NwW0ph98= +github.com/vektah/gqlparser/v2 v2.5.12/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= diff --git a/go.mod b/go.mod index 9ee33477f39..c4639bef1d5 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/sosodev/duration v1.3.1 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.2 - github.com/vektah/gqlparser/v2 v2.5.11 + github.com/vektah/gqlparser/v2 v2.5.12 golang.org/x/text v0.15.0 golang.org/x/tools v0.21.0 google.golang.org/protobuf v1.34.1 diff --git a/go.sum b/go.sum index 16f14b33994..2b5c7ab03ca 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= -github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8= -github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc= +github.com/vektah/gqlparser/v2 v2.5.12 h1:COMhVVnql6RoaF7+aTBWiTADdpLGyZWU3K/NwW0ph98= +github.com/vektah/gqlparser/v2 v2.5.12/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= diff --git a/graphql/version.go b/graphql/version.go index 130a2ea2d50..969273dba4b 100644 --- a/graphql/version.go +++ b/graphql/version.go @@ -1,3 +1,3 @@ package graphql -const Version = "v0.17.46-dev" +const Version = "v0.17.47-dev" diff --git a/integration/package-lock.json b/integration/package-lock.json index 9d773c5a863..0cbde9290b8 100644 --- a/integration/package-lock.json +++ b/integration/package-lock.json @@ -8,9 +8,9 @@ "name": "integration", "version": "0.0.0", "devDependencies": { - "@apollo/client": "^3.10.3", + "@apollo/client": "^3.10.4", "@graphql-codegen/cli": "^5.0.2", - "@graphql-codegen/client-preset": "^4.2.5", + "@graphql-codegen/client-preset": "^4.2.6", "@graphql-codegen/introspection": "^4.0.3", "@graphql-codegen/schema-ast": "^4.0.2", "cross-fetch": "^4.0.0", @@ -52,9 +52,9 @@ } }, "node_modules/@apollo/client": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.3.tgz", - "integrity": "sha512-4EIgZnFmRO1laWv3NCxlVIxcvimG63djuAXvyXhpQH3wkNMv9SykrasKRN08+z+cn/fVisBOLmkSRdyNyP9f4A==", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.4.tgz", + "integrity": "sha512-51gk0xOwN6Ls1EbTG5svFva1kdm2APHYTzmFhaAdvUQoJFDxfc0UwQgDxGptzH84vkPlo1qunY1FuboyF9LI3Q==", "dev": true, "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", @@ -1576,20 +1576,20 @@ } }, "node_modules/@graphql-codegen/client-preset": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.2.5.tgz", - "integrity": "sha512-hAdB6HN8EDmkoBtr0bPUN/7NH6svzqbcTDMWBCRXPESXkl7y80po+IXrXUjsSrvhKG8xkNXgJNz/2mjwHzywcA==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.2.6.tgz", + "integrity": "sha512-e7SzPb+nxNJfsD0uG+NSyzIeTtCXTouX5VThmcCoqGMDLgF5Lo7932B3HtZCvzmzqcXxRjJ81CmkA2LhlqIbCw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/template": "^7.20.7", "@graphql-codegen/add": "^5.0.2", - "@graphql-codegen/gql-tag-operations": "4.0.6", - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/typed-document-node": "^5.0.6", - "@graphql-codegen/typescript": "^4.0.6", - "@graphql-codegen/typescript-operations": "^4.2.0", - "@graphql-codegen/visitor-plugin-common": "^5.1.0", + "@graphql-codegen/gql-tag-operations": "4.0.7", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/typed-document-node": "^5.0.7", + "@graphql-codegen/typescript": "^4.0.7", + "@graphql-codegen/typescript-operations": "^4.2.1", + "@graphql-codegen/visitor-plugin-common": "^5.2.0", "@graphql-tools/documents": "^1.0.0", "@graphql-tools/utils": "^10.0.0", "@graphql-typed-document-node/core": "3.2.0", @@ -1615,13 +1615,13 @@ } }, "node_modules/@graphql-codegen/gql-tag-operations": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.6.tgz", - "integrity": "sha512-y6iXEDpDNjwNxJw3WZqX1/Znj0QHW7+y8O+t2V8qvbTT+3kb2lr9ntc8By7vCr6ctw9tXI4XKaJgpTstJDOwFA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.7.tgz", + "integrity": "sha512-2I69+IDC8pqAohH6cgKse/vPfJ/4TRTJX96PkAKz8S4RD54PUHtBmzCdBInIFEP/vQuH5mFUAaIKXXjznmGOsg==", "dev": true, "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "@graphql-tools/utils": "^10.0.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" @@ -1645,9 +1645,9 @@ } }, "node_modules/@graphql-codegen/plugin-helpers": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.3.tgz", - "integrity": "sha512-yZ1rpULIWKBZqCDlvGIJRSyj1B2utkEdGmXZTBT/GVayP4hyRYlkd36AJV/LfEsVD8dnsKL5rLz2VTYmRNlJ5Q==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.4.tgz", + "integrity": "sha512-MOIuHFNWUnFnqVmiXtrI+4UziMTYrcquljaI5f/T/Bc7oO7sXcfkAvgkNWEEi9xWreYwvuer3VHCuPI/lAFWbw==", "dev": true, "dependencies": { "@graphql-tools/utils": "^10.0.0", @@ -1676,13 +1676,13 @@ } }, "node_modules/@graphql-codegen/typed-document-node": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.6.tgz", - "integrity": "sha512-US0J95hOE2/W/h42w4oiY+DFKG7IetEN1mQMgXXeat1w6FAR5PlIz4JrRrEkiVfVetZ1g7K78SOwBD8/IJnDiA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.7.tgz", + "integrity": "sha512-rgFh96hAbNwPUxLVlRcNhGaw2+y7ZGx7giuETtdO8XzPasTQGWGRkZ3wXQ5UUiTX4X3eLmjnuoXYKT7HoxSznQ==", "dev": true, "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "change-case-all": "1.0.15", "tslib": "~2.6.0" @@ -1692,14 +1692,14 @@ } }, "node_modules/@graphql-codegen/typescript": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.0.6.tgz", - "integrity": "sha512-IBG4N+Blv7KAL27bseruIoLTjORFCT3r+QYyMC3g11uY3/9TPpaUyjSdF70yBe5GIQ6dAgDU+ENUC1v7EPi0rw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.0.7.tgz", + "integrity": "sha512-Gn+JNvQBJhBqH7s83piAJ6UeU/MTj9GXWFO9bdbl8PMLCAM1uFAtg04iHfkGCtDKXcUg5a3Dt/SZG85uk5KuhA==", "dev": true, "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.3", + "@graphql-codegen/plugin-helpers": "^5.0.4", "@graphql-codegen/schema-ast": "^4.0.2", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -1708,14 +1708,14 @@ } }, "node_modules/@graphql-codegen/typescript-operations": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.0.tgz", - "integrity": "sha512-lmuwYb03XC7LNRS8oo9M4/vlOrq/wOKmTLBHlltK2YJ1BO/4K/Q9Jdv/jDmJpNydHVR1fmeF4wAfsIp1f9JibA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.1.tgz", + "integrity": "sha512-LhEPsaP+AI65zfK2j6CBAL4RT0bJL/rR9oRWlvwtHLX0t7YQr4CP4BXgvvej9brYdedAxHGPWeV1tPHy5/z9KQ==", "dev": true, "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/typescript": "^4.0.6", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/typescript": "^4.0.7", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -1724,12 +1724,12 @@ } }, "node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.1.0.tgz", - "integrity": "sha512-eamQxtA9bjJqI2lU5eYoA1GbdMIRT2X8m8vhWYsVQVWD3qM7sx/IqJU0kx0J3Vd4/CSd36BzL6RKwksibytDIg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.2.0.tgz", + "integrity": "sha512-0p8AwmARaZCAlDFfQu6Sz+JV6SjbPDx3y2nNM7WAAf0au7Im/GpJ7Ke3xaIYBc1b2rTZ+DqSTJI/zomENGD9NA==", "dev": true, "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.3", + "@graphql-codegen/plugin-helpers": "^5.0.4", "@graphql-tools/optimize": "^2.0.0", "@graphql-tools/relay-operation-optimizer": "^7.0.0", "@graphql-tools/utils": "^10.0.0", @@ -8105,9 +8105,9 @@ } }, "@apollo/client": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.3.tgz", - "integrity": "sha512-4EIgZnFmRO1laWv3NCxlVIxcvimG63djuAXvyXhpQH3wkNMv9SykrasKRN08+z+cn/fVisBOLmkSRdyNyP9f4A==", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.10.4.tgz", + "integrity": "sha512-51gk0xOwN6Ls1EbTG5svFva1kdm2APHYTzmFhaAdvUQoJFDxfc0UwQgDxGptzH84vkPlo1qunY1FuboyF9LI3Q==", "dev": true, "requires": { "@graphql-typed-document-node/core": "^3.1.1", @@ -9089,20 +9089,20 @@ } }, "@graphql-codegen/client-preset": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.2.5.tgz", - "integrity": "sha512-hAdB6HN8EDmkoBtr0bPUN/7NH6svzqbcTDMWBCRXPESXkl7y80po+IXrXUjsSrvhKG8xkNXgJNz/2mjwHzywcA==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.2.6.tgz", + "integrity": "sha512-e7SzPb+nxNJfsD0uG+NSyzIeTtCXTouX5VThmcCoqGMDLgF5Lo7932B3HtZCvzmzqcXxRjJ81CmkA2LhlqIbCw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/template": "^7.20.7", "@graphql-codegen/add": "^5.0.2", - "@graphql-codegen/gql-tag-operations": "4.0.6", - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/typed-document-node": "^5.0.6", - "@graphql-codegen/typescript": "^4.0.6", - "@graphql-codegen/typescript-operations": "^4.2.0", - "@graphql-codegen/visitor-plugin-common": "^5.1.0", + "@graphql-codegen/gql-tag-operations": "4.0.7", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/typed-document-node": "^5.0.7", + "@graphql-codegen/typescript": "^4.0.7", + "@graphql-codegen/typescript-operations": "^4.2.1", + "@graphql-codegen/visitor-plugin-common": "^5.2.0", "@graphql-tools/documents": "^1.0.0", "@graphql-tools/utils": "^10.0.0", "@graphql-typed-document-node/core": "3.2.0", @@ -9122,13 +9122,13 @@ } }, "@graphql-codegen/gql-tag-operations": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.6.tgz", - "integrity": "sha512-y6iXEDpDNjwNxJw3WZqX1/Znj0QHW7+y8O+t2V8qvbTT+3kb2lr9ntc8By7vCr6ctw9tXI4XKaJgpTstJDOwFA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.7.tgz", + "integrity": "sha512-2I69+IDC8pqAohH6cgKse/vPfJ/4TRTJX96PkAKz8S4RD54PUHtBmzCdBInIFEP/vQuH5mFUAaIKXXjznmGOsg==", "dev": true, "requires": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "@graphql-tools/utils": "^10.0.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" @@ -9146,9 +9146,9 @@ } }, "@graphql-codegen/plugin-helpers": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.3.tgz", - "integrity": "sha512-yZ1rpULIWKBZqCDlvGIJRSyj1B2utkEdGmXZTBT/GVayP4hyRYlkd36AJV/LfEsVD8dnsKL5rLz2VTYmRNlJ5Q==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.4.tgz", + "integrity": "sha512-MOIuHFNWUnFnqVmiXtrI+4UziMTYrcquljaI5f/T/Bc7oO7sXcfkAvgkNWEEi9xWreYwvuer3VHCuPI/lAFWbw==", "dev": true, "requires": { "@graphql-tools/utils": "^10.0.0", @@ -9171,51 +9171,51 @@ } }, "@graphql-codegen/typed-document-node": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.6.tgz", - "integrity": "sha512-US0J95hOE2/W/h42w4oiY+DFKG7IetEN1mQMgXXeat1w6FAR5PlIz4JrRrEkiVfVetZ1g7K78SOwBD8/IJnDiA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.7.tgz", + "integrity": "sha512-rgFh96hAbNwPUxLVlRcNhGaw2+y7ZGx7giuETtdO8XzPasTQGWGRkZ3wXQ5UUiTX4X3eLmjnuoXYKT7HoxSznQ==", "dev": true, "requires": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "change-case-all": "1.0.15", "tslib": "~2.6.0" } }, "@graphql-codegen/typescript": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.0.6.tgz", - "integrity": "sha512-IBG4N+Blv7KAL27bseruIoLTjORFCT3r+QYyMC3g11uY3/9TPpaUyjSdF70yBe5GIQ6dAgDU+ENUC1v7EPi0rw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.0.7.tgz", + "integrity": "sha512-Gn+JNvQBJhBqH7s83piAJ6UeU/MTj9GXWFO9bdbl8PMLCAM1uFAtg04iHfkGCtDKXcUg5a3Dt/SZG85uk5KuhA==", "dev": true, "requires": { - "@graphql-codegen/plugin-helpers": "^5.0.3", + "@graphql-codegen/plugin-helpers": "^5.0.4", "@graphql-codegen/schema-ast": "^4.0.2", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" } }, "@graphql-codegen/typescript-operations": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.0.tgz", - "integrity": "sha512-lmuwYb03XC7LNRS8oo9M4/vlOrq/wOKmTLBHlltK2YJ1BO/4K/Q9Jdv/jDmJpNydHVR1fmeF4wAfsIp1f9JibA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.2.1.tgz", + "integrity": "sha512-LhEPsaP+AI65zfK2j6CBAL4RT0bJL/rR9oRWlvwtHLX0t7YQr4CP4BXgvvej9brYdedAxHGPWeV1tPHy5/z9KQ==", "dev": true, "requires": { - "@graphql-codegen/plugin-helpers": "^5.0.3", - "@graphql-codegen/typescript": "^4.0.6", - "@graphql-codegen/visitor-plugin-common": "5.1.0", + "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/typescript": "^4.0.7", + "@graphql-codegen/visitor-plugin-common": "5.2.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" } }, "@graphql-codegen/visitor-plugin-common": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.1.0.tgz", - "integrity": "sha512-eamQxtA9bjJqI2lU5eYoA1GbdMIRT2X8m8vhWYsVQVWD3qM7sx/IqJU0kx0J3Vd4/CSd36BzL6RKwksibytDIg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.2.0.tgz", + "integrity": "sha512-0p8AwmARaZCAlDFfQu6Sz+JV6SjbPDx3y2nNM7WAAf0au7Im/GpJ7Ke3xaIYBc1b2rTZ+DqSTJI/zomENGD9NA==", "dev": true, "requires": { - "@graphql-codegen/plugin-helpers": "^5.0.3", + "@graphql-codegen/plugin-helpers": "^5.0.4", "@graphql-tools/optimize": "^2.0.0", "@graphql-tools/relay-operation-optimizer": "^7.0.0", "@graphql-tools/utils": "^10.0.0", diff --git a/integration/package.json b/integration/package.json index 5f1dcbc7582..f0bd6f057d3 100644 --- a/integration/package.json +++ b/integration/package.json @@ -8,9 +8,9 @@ "gen": "graphql-codegen --config codegen.ts" }, "devDependencies": { - "@apollo/client": "^3.10.3", + "@apollo/client": "^3.10.4", "@graphql-codegen/cli": "^5.0.2", - "@graphql-codegen/client-preset": "^4.2.5", + "@graphql-codegen/client-preset": "^4.2.6", "@graphql-codegen/introspection": "^4.0.3", "@graphql-codegen/schema-ast": "^4.0.2", "cross-fetch": "^4.0.0", diff --git a/plugin/federation/testdata/entityresolver/entity.resolvers.go b/plugin/federation/testdata/entityresolver/entity.resolvers.go index 85451029725..eda1dcdbdbe 100644 --- a/plugin/federation/testdata/entityresolver/entity.resolvers.go +++ b/plugin/federation/testdata/entityresolver/entity.resolvers.go @@ -2,7 +2,7 @@ package entityresolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/plugin/federation/testdata/explicitrequires/entity.resolvers.go b/plugin/federation/testdata/explicitrequires/entity.resolvers.go index 0f0d25908ec..7cea9ba6770 100644 --- a/plugin/federation/testdata/explicitrequires/entity.resolvers.go +++ b/plugin/federation/testdata/explicitrequires/entity.resolvers.go @@ -2,7 +2,7 @@ package explicitrequires // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.46-dev +// Code generated by github.com/99designs/gqlgen version v0.17.47-dev import ( "context" diff --git a/plugin/plugin.go b/plugin/plugin.go index ccb8f8b9346..a5e1ba848d7 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -33,5 +33,5 @@ type LateSourceInjector interface { // ResolverImplementer is used to generate code inside resolvers type ResolverImplementer interface { - Implement(field *codegen.Field) string + Implement(prevImplementation string, field *codegen.Field) string } diff --git a/plugin/resolvergen/resolver.go b/plugin/resolvergen/resolver.go index 085c2958470..97a20477165 100644 --- a/plugin/resolvergen/resolver.go +++ b/plugin/resolvergen/resolver.go @@ -127,14 +127,9 @@ func (m *Plugin) generatePerSchema(data *codegen.Data) error { if !f.IsResolver { continue } - structName := templates.LcFirst(o.Name) + templates.UcFirst(data.Config.Resolver.Type) comment := strings.TrimSpace(strings.TrimLeft(rewriter.GetMethodComment(structName, f.GoFieldName), `\`)) implementation := strings.TrimSpace(rewriter.GetMethodBody(structName, f.GoFieldName)) - if implementation == "" { - // use default implementation, if no implementation was previously used - implementation = fmt.Sprintf("panic(fmt.Errorf(\"not implemented: %v - %v\"))", f.GoFieldName, f.Name) - } resolver := Resolver{o, f, rewriter.GetPrevDecl(structName, f.GoFieldName), comment, implementation, nil} var implExists bool for _, p := range data.Plugins { @@ -257,13 +252,20 @@ type Resolver struct { PrevDecl *ast.FuncDecl Comment string ImplementationStr string - ImplementationRender func(r *codegen.Field) string + ImplementationRender func(prevImplementation string, r *codegen.Field) string } func (r *Resolver) Implementation() string { if r.ImplementationRender != nil { - return r.ImplementationRender(r.Field) + // use custom implementation + return r.ImplementationRender(r.ImplementationStr, r.Field) + } + // if not implementation was previously used, use default implementation + if r.ImplementationStr == "" { + // use default implementation, if no implementation was previously used + return fmt.Sprintf("panic(fmt.Errorf(\"not implemented: %v - %v\"))", r.Field.GoFieldName, r.Field.Name) } + // use previously used implementation return r.ImplementationStr } diff --git a/plugin/resolvergen/resolver_test.go b/plugin/resolvergen/resolver_test.go index 7c590b9e4c2..db84a5b3fd7 100644 --- a/plugin/resolvergen/resolver_test.go +++ b/plugin/resolvergen/resolver_test.go @@ -163,6 +163,6 @@ func assertNoErrors(t *testing.T, pkg string) { type implementorTest struct{} -func (i *implementorTest) Implement(field *codegen.Field) string { +func (i *implementorTest) Implement(_ string, _ *codegen.Field) string { return "panic(\"implementor implemented me\")" }