99designs / 99designs/gqlgen

How to access the arguments of a query within the RequestContext Object ?

Open
#1,144 12 comments 5 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?

Hi there,
When trying to obtain the variables from a request context Object (with `graphql.GetRequestContext(ctx).Variables` with the following query:
```
query MyQuery {
queryNode(filter:{isRoot:true}) {
name
}
}
```
I obtain a empty map.

### What did you expect?

` map[filter: map[isRoot:true]]`

Furthermore, I get the desired result if I use
```
query MyQuery($args: MyArgs!) {
queryNode(filter:$args) {
name
}
}

{ "args": {"isRoot": true}}
```

### versions
- glqgen : v0.11.3
- go: 1.14.1
- gqlparser: v2/v2.0.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.