Closed btsomogyi closed 5 months ago
You probably want to bind to encoding/json.RawMessage
, which is the Go convention for "leave this part of the JSON as JSON"; string
has to map to a JSON string. If that doesn't work, I think you'll need to post a more complete repro (e.g. a full schema + config + sample server response) so we can see what's going on! (And if it does, documentation PRs to make this clearer are very welcome!)
Describe the bug When using genqlient with a schema that is generated from Strawberry that includes
strawberry.scalars import JSON
and includes a stanzain the schema file, an attempt to use a field with this scalar in a query results in the error during
go generate
:However, adding
to the genqlient.yaml file only produces the following error when attempting to execute a query accessing this JSON containing field:
To Reproduce Provided above, using Golang version 1.21.7 and genqlient
github.com/Khan/genqlient v0.6.0
% go version go version go1.21.7 darwin/arm64Expected behavior I would expect the JSON field to be stored in a string.
genqlient version v0.6.0
Additional context There are no errors occurring on the Strawberry GraphQL server (providing a 200 response to client)