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

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

Open
4 tasks
julioxavierr opened this issue Dec 4, 2023 · 1 comment
Open
4 tasks
Labels
kind/bug Something isn't working stage/0-issue-prerequisites Needs more information before we can start working on it

Comments

@julioxavierr
Copy link

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a
    minimal reproduction available on
    Stackblitz.
    • 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.

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
@EmrysMyrddin EmrysMyrddin added kind/bug Something isn't working stage/0-issue-prerequisites Needs more information before we can start working on it labels Dec 5, 2023
@EmrysMyrddin
Copy link
Collaborator

Hi @julioxavierr and thank you for the report!

Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow.

One way of pushing this forward would be to add an example of the input and the output you expect to get.
You can provide a live reproduction using Stackblitz.
Maybe even adding a failing test so we could get this into stage 2!

Thank you and sorry that this comment is not a complete solution (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stage/0-issue-prerequisites Needs more information before we can start working on it
Projects
None yet
Development

No branches or pull requests

2 participants