From ecf08bea5f22a4108ffb2b946ff3e2c02bf12c93 Mon Sep 17 00:00:00 2001 From: lkeix Date: Wed, 4 Dec 2024 20:12:27 +0900 Subject: [PATCH] tuning: json encoding/decoding by go-json --- _examples/go.mod | 1 + _examples/go.sum | 2 ++ client/client.go | 2 +- client/client_test.go | 2 +- client/errors.go | 2 +- client/sse.go | 2 +- client/websocket.go | 2 +- client/withfilesoption.go | 2 +- codegen/testserver/followschema/mutation_with_custom_scalar.go | 2 +- codegen/testserver/singlefile/defer_test.go | 2 +- codegen/testserver/singlefile/mutation_with_custom_scalar.go | 2 +- docs/content/recipes/federation.md | 2 +- docs/content/reference/model-generation.md | 2 +- go.mod | 1 + go.sum | 2 ++ graphql/any.go | 2 +- graphql/coercion.go | 2 +- graphql/coercion_test.go | 2 +- graphql/executor/testexecutor/testexecutor.go | 2 +- graphql/float.go | 2 +- graphql/handler/apollofederatedtracingv1/tracing_test.go | 2 +- graphql/handler/apollotracing/tracer_test.go | 2 +- graphql/handler/debug/tracer.go | 2 +- graphql/handler/server.go | 2 +- graphql/handler/transport/error.go | 2 +- graphql/handler/transport/http_form_multipart.go | 2 +- graphql/handler/transport/http_get.go | 2 +- graphql/handler/transport/http_multipart_mixed.go | 2 +- graphql/handler/transport/sse.go | 2 +- graphql/handler/transport/util.go | 2 +- graphql/handler/transport/websocket.go | 2 +- graphql/handler/transport/websocket_graphql_transport_ws.go | 2 +- graphql/handler/transport/websocket_graphqlws.go | 2 +- graphql/handler/transport/websocket_subprotocol.go | 2 +- graphql/handler/transport/websocket_test.go | 2 +- graphql/id.go | 2 +- graphql/id_test.go | 2 +- graphql/int.go | 2 +- graphql/int_test.go | 2 +- graphql/map.go | 2 +- graphql/omittable.go | 2 +- graphql/omittable_test.go | 2 +- graphql/playground/apollo_sandbox_playground.go | 2 +- graphql/response.go | 2 +- graphql/string.go | 2 +- graphql/string_test.go | 2 +- graphql/uint.go | 2 +- graphql/uint_test.go | 2 +- plugin/federation/federation_entityresolver_test.go | 2 +- plugin/federation/testdata/computedrequires/schema.resolvers.go | 2 +- .../testdata/explicitrequires/generated/federation.requires.go | 2 +- .../testdata/resolvertemplate/customResolverTemplate.gotpl | 2 +- 52 files changed, 54 insertions(+), 48 deletions(-) diff --git a/_examples/go.mod b/_examples/go.mod index 0127b4cd7cb..239fe9b259a 100644 --- a/_examples/go.mod +++ b/_examples/go.mod @@ -19,6 +19,7 @@ require ( require ( github.com/agnivade/levenshtein v1.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/logrusorgru/aurora/v4 v4.0.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/_examples/go.sum b/_examples/go.sum index 8c005fd1834..d536f812170 100644 --- a/_examples/go.sum +++ b/_examples/go.sum @@ -15,6 +15,8 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= diff --git a/client/client.go b/client/client.go index ea3b4a3d201..0321a5a8768 100644 --- a/client/client.go +++ b/client/client.go @@ -4,7 +4,7 @@ package client import ( "bytes" - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "net/http" diff --git a/client/client_test.go b/client/client_test.go index ed0a78ac3de..7f3ab4bf4c0 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -2,7 +2,7 @@ package client_test import ( "bytes" - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "mime/multipart" diff --git a/client/errors.go b/client/errors.go index 7bbdd41735d..229a3b1837f 100644 --- a/client/errors.go +++ b/client/errors.go @@ -1,6 +1,6 @@ package client -import "encoding/json" +import "github.com/goccy/go-json" // RawJsonError is a json formatted error from a GraphQL server. type RawJsonError struct { diff --git a/client/sse.go b/client/sse.go index d173a27f842..8a40f2408fc 100644 --- a/client/sse.go +++ b/client/sse.go @@ -3,7 +3,7 @@ package client import ( "bufio" "context" - "encoding/json" + "github.com/goccy/go-json" "fmt" "net/http/httptest" "net/textproto" diff --git a/client/websocket.go b/client/websocket.go index 6a14f7fead6..ce8b956f559 100644 --- a/client/websocket.go +++ b/client/websocket.go @@ -1,7 +1,7 @@ package client import ( - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "io" diff --git a/client/withfilesoption.go b/client/withfilesoption.go index 86bdbeeb90a..21719c70a31 100644 --- a/client/withfilesoption.go +++ b/client/withfilesoption.go @@ -2,7 +2,7 @@ package client import ( "bytes" - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "mime/multipart" diff --git a/codegen/testserver/followschema/mutation_with_custom_scalar.go b/codegen/testserver/followschema/mutation_with_custom_scalar.go index 5683ad3d03a..c59d1f3296e 100644 --- a/codegen/testserver/followschema/mutation_with_custom_scalar.go +++ b/codegen/testserver/followschema/mutation_with_custom_scalar.go @@ -1,7 +1,7 @@ package followschema import ( - "encoding/json" + "github.com/goccy/go-json" "errors" "io" "regexp" diff --git a/codegen/testserver/singlefile/defer_test.go b/codegen/testserver/singlefile/defer_test.go index b0c56e86056..8d6399f0dc5 100644 --- a/codegen/testserver/singlefile/defer_test.go +++ b/codegen/testserver/singlefile/defer_test.go @@ -3,7 +3,7 @@ package singlefile import ( "cmp" "context" - "encoding/json" + "github.com/goccy/go-json" "math/rand" "reflect" "slices" diff --git a/codegen/testserver/singlefile/mutation_with_custom_scalar.go b/codegen/testserver/singlefile/mutation_with_custom_scalar.go index ee5ea57817c..01955f34d6b 100644 --- a/codegen/testserver/singlefile/mutation_with_custom_scalar.go +++ b/codegen/testserver/singlefile/mutation_with_custom_scalar.go @@ -1,7 +1,7 @@ package singlefile import ( - "encoding/json" + "github.com/goccy/go-json" "errors" "io" "regexp" diff --git a/docs/content/recipes/federation.md b/docs/content/recipes/federation.md index 291cd73a0ad..f173befc51d 100644 --- a/docs/content/recipes/federation.md +++ b/docs/content/recipes/federation.md @@ -227,7 +227,7 @@ genrated resolver functions that include a new argument, `federationRequires`, t fields you requested in your `@requires.fields` selection set. > Note: currently it's represented as a map[string]any where the contained values are encoded with -`encoding/json`. Eventually we will generate a typesafe model that represents these models, +`github.com/goccy/go-json`. Eventually we will generate a typesafe model that represents these models, however that is a large lift. This typesafe support will be added in the future. ### Example diff --git a/docs/content/reference/model-generation.md b/docs/content/reference/model-generation.md index 1ec40deb1aa..e42f4a42c37 100644 --- a/docs/content/reference/model-generation.md +++ b/docs/content/reference/model-generation.md @@ -11,7 +11,7 @@ advantageous, or even necessary, to have control over some aspects of this outpu ## json ",omitempty" By default, fields that are marked as nullable in the GraphQL schema, e.g. `field: String` rather than `field: String!`, -have the [json ",omitempty"](https://pkg.go.dev/encoding/json#Marshal) field tag applied to them. This is probably fine +have the [json ",omitempty"](https://pkg.go.dev/github.com/goccy/go-json#Marshal) field tag applied to them. This is probably fine if the downstream consumers of json serialized representations of this model are all written in Go, but obviously this is not always true. diff --git a/go.mod b/go.mod index 65ee358052d..ac9c133d494 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,7 @@ require ( github.com/andybalholm/cascadia v1.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect diff --git a/go.sum b/go.sum index 5656462f875..24c320b8dc8 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= diff --git a/graphql/any.go b/graphql/any.go index be600b2f428..cb5a27de397 100644 --- a/graphql/any.go +++ b/graphql/any.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "io" ) diff --git a/graphql/coercion.go b/graphql/coercion.go index 533ab82149d..e378381cf41 100644 --- a/graphql/coercion.go +++ b/graphql/coercion.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" ) // CoerceList applies coercion from a single value to a list. diff --git a/graphql/coercion_test.go b/graphql/coercion_test.go index 7402899f178..d5dda09102f 100644 --- a/graphql/coercion_test.go +++ b/graphql/coercion_test.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "testing" "github.com/stretchr/testify/assert" diff --git a/graphql/executor/testexecutor/testexecutor.go b/graphql/executor/testexecutor/testexecutor.go index e086a4876a1..e02e22d7831 100644 --- a/graphql/executor/testexecutor/testexecutor.go +++ b/graphql/executor/testexecutor/testexecutor.go @@ -3,7 +3,7 @@ package testexecutor import ( "bytes" "context" - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "io" diff --git a/graphql/float.go b/graphql/float.go index b140d5bc747..c49bd8a9e4f 100644 --- a/graphql/float.go +++ b/graphql/float.go @@ -2,7 +2,7 @@ package graphql import ( "context" - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "io" diff --git a/graphql/handler/apollofederatedtracingv1/tracing_test.go b/graphql/handler/apollofederatedtracingv1/tracing_test.go index 8baf6d2a232..e718f47b6ec 100644 --- a/graphql/handler/apollofederatedtracingv1/tracing_test.go +++ b/graphql/handler/apollofederatedtracingv1/tracing_test.go @@ -3,7 +3,7 @@ package apollofederatedtracingv1_test import ( "context" "encoding/base64" - "encoding/json" + "github.com/goccy/go-json" "io" "net/http" "net/http/httptest" diff --git a/graphql/handler/apollotracing/tracer_test.go b/graphql/handler/apollotracing/tracer_test.go index fca76d2ceeb..655780d1243 100644 --- a/graphql/handler/apollotracing/tracer_test.go +++ b/graphql/handler/apollotracing/tracer_test.go @@ -1,7 +1,7 @@ package apollotracing_test import ( - "encoding/json" + "github.com/goccy/go-json" "io" "net/http" "net/http/httptest" diff --git a/graphql/handler/debug/tracer.go b/graphql/handler/debug/tracer.go index 5c75565c66d..1cd43a0932f 100644 --- a/graphql/handler/debug/tracer.go +++ b/graphql/handler/debug/tracer.go @@ -2,7 +2,7 @@ package debug import ( "context" - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "os" diff --git a/graphql/handler/server.go b/graphql/handler/server.go index 644bad8d998..be15cd63e21 100644 --- a/graphql/handler/server.go +++ b/graphql/handler/server.go @@ -2,7 +2,7 @@ package handler import ( "context" - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "net/http" diff --git a/graphql/handler/transport/error.go b/graphql/handler/transport/error.go index 1fefb5738c6..2ada15e8a76 100644 --- a/graphql/handler/transport/error.go +++ b/graphql/handler/transport/error.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "net/http" diff --git a/graphql/handler/transport/http_form_multipart.go b/graphql/handler/transport/http_form_multipart.go index b9eb5f8f433..ecf6251f0b2 100644 --- a/graphql/handler/transport/http_form_multipart.go +++ b/graphql/handler/transport/http_form_multipart.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "io" "mime" "net/http" diff --git a/graphql/handler/transport/http_get.go b/graphql/handler/transport/http_get.go index 09f1020d03c..62d4b6a0b27 100644 --- a/graphql/handler/transport/http_get.go +++ b/graphql/handler/transport/http_get.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "io" "net/http" "net/url" diff --git a/graphql/handler/transport/http_multipart_mixed.go b/graphql/handler/transport/http_multipart_mixed.go index 9cf1b533930..0b3e5935591 100644 --- a/graphql/handler/transport/http_multipart_mixed.go +++ b/graphql/handler/transport/http_multipart_mixed.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "log" diff --git a/graphql/handler/transport/sse.go b/graphql/handler/transport/sse.go index 1d59fdffe57..7620da28b74 100644 --- a/graphql/handler/transport/sse.go +++ b/graphql/handler/transport/sse.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "log" diff --git a/graphql/handler/transport/util.go b/graphql/handler/transport/util.go index f2a0d357af5..81927c52aa9 100644 --- a/graphql/handler/transport/util.go +++ b/graphql/handler/transport/util.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" diff --git a/graphql/handler/transport/websocket.go b/graphql/handler/transport/websocket.go index d6c174cd1fb..137060bcacd 100644 --- a/graphql/handler/transport/websocket.go +++ b/graphql/handler/transport/websocket.go @@ -3,7 +3,7 @@ package transport import ( "bytes" "context" - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "log" diff --git a/graphql/handler/transport/websocket_graphql_transport_ws.go b/graphql/handler/transport/websocket_graphql_transport_ws.go index bfb12541a5b..15da941205d 100644 --- a/graphql/handler/transport/websocket_graphql_transport_ws.go +++ b/graphql/handler/transport/websocket_graphql_transport_ws.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "github.com/gorilla/websocket" diff --git a/graphql/handler/transport/websocket_graphqlws.go b/graphql/handler/transport/websocket_graphqlws.go index d690cec4643..e35565642b7 100644 --- a/graphql/handler/transport/websocket_graphqlws.go +++ b/graphql/handler/transport/websocket_graphqlws.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "github.com/gorilla/websocket" diff --git a/graphql/handler/transport/websocket_subprotocol.go b/graphql/handler/transport/websocket_subprotocol.go index c02098a88e5..9f6e9170935 100644 --- a/graphql/handler/transport/websocket_subprotocol.go +++ b/graphql/handler/transport/websocket_subprotocol.go @@ -1,7 +1,7 @@ package transport import ( - "encoding/json" + "github.com/goccy/go-json" "errors" "github.com/gorilla/websocket" diff --git a/graphql/handler/transport/websocket_test.go b/graphql/handler/transport/websocket_test.go index cc02018053d..e55bd8cbc2a 100644 --- a/graphql/handler/transport/websocket_test.go +++ b/graphql/handler/transport/websocket_test.go @@ -2,7 +2,7 @@ package transport_test import ( "context" - "encoding/json" + "github.com/goccy/go-json" "errors" "net/http" "net/http/httptest" diff --git a/graphql/id.go b/graphql/id.go index 2a946dfa742..d516e0328ed 100644 --- a/graphql/id.go +++ b/graphql/id.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "strconv" diff --git a/graphql/id_test.go b/graphql/id_test.go index 41e4be86e01..171a718ba11 100644 --- a/graphql/id_test.go +++ b/graphql/id_test.go @@ -2,7 +2,7 @@ package graphql import ( "bytes" - "encoding/json" + "github.com/goccy/go-json" "math" "testing" diff --git a/graphql/int.go b/graphql/int.go index 41cad3f1f33..ff249647859 100644 --- a/graphql/int.go +++ b/graphql/int.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "strconv" diff --git a/graphql/int_test.go b/graphql/int_test.go index 7cb812a4eac..07c2eed15a9 100644 --- a/graphql/int_test.go +++ b/graphql/int_test.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "testing" "github.com/stretchr/testify/assert" diff --git a/graphql/map.go b/graphql/map.go index 1e91d1d98c1..931061ecb50 100644 --- a/graphql/map.go +++ b/graphql/map.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" ) diff --git a/graphql/omittable.go b/graphql/omittable.go index 89716400b69..809695bd73e 100644 --- a/graphql/omittable.go +++ b/graphql/omittable.go @@ -1,6 +1,6 @@ package graphql -import "encoding/json" +import "github.com/goccy/go-json" // Omittable is a wrapper around a value that also stores whether it is set // or not. diff --git a/graphql/omittable_test.go b/graphql/omittable_test.go index 5081197eb52..b1bbb8af9b4 100644 --- a/graphql/omittable_test.go +++ b/graphql/omittable_test.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "testing" "github.com/stretchr/testify/assert" diff --git a/graphql/playground/apollo_sandbox_playground.go b/graphql/playground/apollo_sandbox_playground.go index f998b4d8c37..5fdb7acc914 100644 --- a/graphql/playground/apollo_sandbox_playground.go +++ b/graphql/playground/apollo_sandbox_playground.go @@ -1,7 +1,7 @@ package playground import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "html/template" "net/http" diff --git a/graphql/response.go b/graphql/response.go index e37b5cfc1ed..c43e3ecd5c1 100644 --- a/graphql/response.go +++ b/graphql/response.go @@ -2,7 +2,7 @@ package graphql import ( "context" - "encoding/json" + "github.com/goccy/go-json" "fmt" "github.com/vektah/gqlparser/v2/ast" diff --git a/graphql/string.go b/graphql/string.go index 6622734e3e0..93be3196bdc 100644 --- a/graphql/string.go +++ b/graphql/string.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "fmt" "io" "strconv" diff --git a/graphql/string_test.go b/graphql/string_test.go index 5ca1c36a4d3..445e086330f 100644 --- a/graphql/string_test.go +++ b/graphql/string_test.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "testing" "github.com/stretchr/testify/assert" diff --git a/graphql/uint.go b/graphql/uint.go index cd5d2355036..af66c13de03 100644 --- a/graphql/uint.go +++ b/graphql/uint.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "errors" "fmt" "io" diff --git a/graphql/uint_test.go b/graphql/uint_test.go index 4d7ad1796a9..e2b7450ded3 100644 --- a/graphql/uint_test.go +++ b/graphql/uint_test.go @@ -1,7 +1,7 @@ package graphql import ( - "encoding/json" + "github.com/goccy/go-json" "math" "testing" diff --git a/plugin/federation/federation_entityresolver_test.go b/plugin/federation/federation_entityresolver_test.go index e4b3949d43c..80fe0f43140 100644 --- a/plugin/federation/federation_entityresolver_test.go +++ b/plugin/federation/federation_entityresolver_test.go @@ -2,7 +2,7 @@ package federation import ( - "encoding/json" + "github.com/goccy/go-json" "strconv" "strings" "testing" diff --git a/plugin/federation/testdata/computedrequires/schema.resolvers.go b/plugin/federation/testdata/computedrequires/schema.resolvers.go index a482f307684..b194b52f5af 100644 --- a/plugin/federation/testdata/computedrequires/schema.resolvers.go +++ b/plugin/federation/testdata/computedrequires/schema.resolvers.go @@ -6,7 +6,7 @@ package computedrequires import ( "context" - "encoding/json" + "github.com/goccy/go-json" "fmt" explicitrequires "github.com/99designs/gqlgen/plugin/federation/testdata/computedrequires/generated" diff --git a/plugin/federation/testdata/explicitrequires/generated/federation.requires.go b/plugin/federation/testdata/explicitrequires/generated/federation.requires.go index 1a3a9335114..61e0960d913 100644 --- a/plugin/federation/testdata/explicitrequires/generated/federation.requires.go +++ b/plugin/federation/testdata/explicitrequires/generated/federation.requires.go @@ -2,7 +2,7 @@ package generated import ( "context" - "encoding/json" + "github.com/goccy/go-json" "fmt" ) diff --git a/plugin/resolvergen/testdata/resolvertemplate/customResolverTemplate.gotpl b/plugin/resolvergen/testdata/resolvertemplate/customResolverTemplate.gotpl index ff652f01480..63339a008bf 100644 --- a/plugin/resolvergen/testdata/resolvertemplate/customResolverTemplate.gotpl +++ b/plugin/resolvergen/testdata/resolvertemplate/customResolverTemplate.gotpl @@ -6,7 +6,7 @@ {{ reserveImport "sync" }} {{ reserveImport "errors" }} {{ reserveImport "bytes" }} -{{ reserveImport "encoding/json" }} +{{ reserveImport "github.com/goccy/go-json" }} {{ reserveImport "github.com/vektah/gqlparser/v2" }} {{ reserveImport "github.com/vektah/gqlparser/v2/ast" }}