Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperationContext contains empty variables for variable with query #3223

Open
khumps opened this issue Aug 14, 2024 · 0 comments
Open

OperationContext contains empty variables for variable with query #3223

khumps opened this issue Aug 14, 2024 · 0 comments

Comments

@khumps
Copy link

khumps commented Aug 14, 2024

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 with v0.17.44. Updated to v0.17.49 and it still happens
  • go version?
    go version go1.22.4 linux/amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant