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

[BUG] Random ] get added to GraphQL mutation input #1143

Closed
Lennix opened this issue Dec 4, 2023 · 3 comments · Fixed by #1154
Closed

[BUG] Random ] get added to GraphQL mutation input #1143

Lennix opened this issue Dec 4, 2023 · 3 comments · Fixed by #1154

Comments

@Lennix
Copy link

Lennix commented Dec 4, 2023

I hope this is no duplicate, but I couldn't find any similar issue.

My graphql input gets altered by bruno resulting in a badly formatted graphql mutation.
This just started occuring since I updated to OSX Sonoma (but I can't explain why that should be the reason).
I'm on 1.3.2, but it also occured on 1.3.0.

This is my mutation:

mutation {
  authenticate(input: { native: { username: "superadmin", password: "superadmin"}}) {
    __typename
    ... on CurrentUser {
      id
      identifier
    }
  }
}

Resulting query:

{"query":"mutation {\n authenticate(input: { native: { username: \"superadmin\", password: \"superadmin\"]}}) {\n __typename\n ... on CurrentUser {\n id\n identifier\n }\n }\n}","variables":{}}

You can see that after the password value a "]" is added. The schema does not accept an array as input.
"superadmin"]}

Any ideas are appreciated.

@Its-treason
Copy link
Member

Its-treason commented Dec 4, 2023

This seems to be a bug caused by #964 / #bad9d0. We probably need to update how the replacing works, so it only replaced {{ & }} when used for variables.

CC: @nelup20 @helloanoop

@Lennix
Copy link
Author

Lennix commented Dec 4, 2023

Yes, I can confirm that adding spaces between the brackets fixes the issue.

@nelup20
Copy link
Contributor

nelup20 commented Dec 4, 2023

Thanks for checking @Its-treason, it's indeed caused by that change (was able to reproduce it). I'll fix it 👍

nelup20 added a commit to nelup20/bruno that referenced this issue Dec 5, 2023
…n in string only to variables that are not process env vars
nelup20 added a commit to nelup20/bruno that referenced this issue Dec 5, 2023
nelup20 added a commit to nelup20/bruno that referenced this issue Jan 20, 2024
helloanoop pushed a commit that referenced this issue Jan 25, 2024
…n variables + Add to CLI (#1154)

* fix(#1143): Fix PR #971 - Add literal-segment notation in string only to variables that are not process env vars
* fix(#1143): Fix PR #971 - Add to CLI as well
* fix(#1143): Fix PR #971 - Use improved Regex after CR + add test case for escaped vars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants