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

No Variable Replacement in graphQl Request Body #3210

Closed
2 tasks done
Andreas-Schoenefeldt opened this issue Sep 27, 2024 · 4 comments · Fixed by #3212
Closed
2 tasks done

No Variable Replacement in graphQl Request Body #3210

Andreas-Schoenefeldt opened this issue Sep 27, 2024 · 4 comments · Fixed by #3212
Labels
bug Something isn't working

Comments

@Andreas-Schoenefeldt
Copy link
Contributor

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

I can not tell when it stopped working, but Variables in graphQl request are no longer replaced for me (currently on v1.30.1 on Mac OS, at least from 1.28.0).

This is my request:

Request Script:

var timestamp = new Date().getTime();
bru.setVar("TIMESTAMP", timestamp);

Query:

mutation addCategory($data: AddCategoryInput!) {
  addCategory(input: $data) {
    ...CategoryFragment
    __typename
  }
}

fragment CategoryFragment on Category {
  id
  name
  parentId
  parentType
  __typename
}

Variables:

{
  "data": {
    "name": "{\"en\":\"Category - {{TIMESTAMP}}\"}",
    "parentType": "Project",
    "parentId": "8"
  }
}

{{TIMESTAMP}} used to be correctly replaced by a timestamp, now it is not anymore:

> POST https://127.0.0.1:8000/graphql/graphql/app
> X-AUTH-TOKEN: xyz
> content-type: application/json
> cookie: PHPSESSID=123
> data
{
  "query": "mutation addCategory($data: AddCategoryInput!) {\n  addCategory(input: $data) {\n    ...CategoryFragment\n    __typename\n  }\n}\n\nfragment CategoryFragment on Category {\n  id\n  name\n  parentId\n  parentType\n  __typename\n}\n",
  "variables": {
    "data": {
      "name": "{\"en\":\"Category - {{TIMESTAMP}}\"}", 
      "parentType": "Project",
      "parentId": "8"
    }
  }
}

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Screenshot 2024-09-27 at 10 28 09
@Andreas-Schoenefeldt Andreas-Schoenefeldt added the bug Something isn't working label Sep 27, 2024
@Citizen4our
Copy link

Hello, I have the same bug.
It worked on 1.26.2 version, from 1.27 - no.
Video with versions:
1.26.2
1.27
1.30.1

CleanShot.2024-09-27.at.12.36.54.mp4

@Andreas-Schoenefeldt
Copy link
Contributor Author

It woulb be good, if the testcoverage would prevent a bug in such an important core functionality. In my opinion this is a blocker issue.

@helloanoop
Copy link
Contributor

helloanoop commented Sep 30, 2024

Just merged the PR - #3212 for the fix. This will be available in the upcoming v1.32.0 release.

@Andreas-Schoenefeldt
Copy link
Contributor Author

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants