gqlgen
gqlgen copied to clipboard
OperationContext contains empty variables for variable with query
What happened?
setting up the following for the handler
srv.AroundOperations(func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler {
oc := graphql.GetOperationContext(ctx)
fmt.Printf("%+v", oc.Variables)
return next(ctx)
})
prints map[]
on the following query
query Query {
genConfigJson(id: 1234567)
}
The query succeeds and returns data in graphiql
What did you expect?
the print statement should have printed {"id":1234567}
Minimal graphql.schema and models to reproduce
scalar Map
type Query {
genConfigJson(id: [Int!]): [Map!]
}
versions
-
go run github.com/99designs/gqlgen version
? Initially tried withv0.17.44
. Updated tov0.17.49
and it still happens -
go version
?go version go1.22.4 linux/amd64