graphql-hive / graphql-hive/envelop

Arguments for the same field with an alias are being cached / ignored

Open
#2,101 1 comment 0 reactions 0 assignees View on GitHub
kind/bug stage/0-issue-prerequisites
Dominant language
No language data
Stars
827
Forks
132
PR merge metrics
No merged PRs in 30d

Description

### Issue workflow progress

_Progress of the issue based on the
[Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-contributor-workflow)_

- [ ] 1. The issue provides a
[minimal reproduction](https://en.wikipedia.org/wiki/Minimal_reproducible_example) available on
[Stackblitz](https://stackblitz.com/fork/node).
- _Please install the latest `@envelop/*` packages that you are using._
- _Please make sure the reproduction is as small as possible._
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review

---

**Describe the bug**

When using a field more than once in a query, the second usage ignores the args passed.

This issue started happening on `@envelop/core@4.0.3`. It doesn't happen for previous versions.

**To Reproduce** Steps to reproduce the behavior:

In the example below, both "currentBalance" and "previousBalance" will receive the same arguments when processing the request.

```graphql
query {
account {
id
currentBalance: balance(filter: { date: { lte: $currentDate } })
previousBalance: balance(filter: { date: { lte: $previousDate } })
}
}
```

**Expected behavior**

Each usage of the field should take in consideration the arguments passed.

**Environment:**

- OS:
- NodeJS: 18.17.1
- `@envelop/*` versions:
- `@envelop/core`: `4.0.3`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.