Skip to content

Nodejs - generate GraphQL request incorrect multi line query #337

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

Closed
HuyNVuong opened this issue Sep 10, 2020 · 3 comments · Fixed by postmanlabs/postman-app-support#9206 or postmanlabs/postman-app-support#9222
Labels
bug Something isn't working

Comments

@HuyNVuong
Copy link
Contributor

Describe the bug
On any Nodejs request, GraphQL request is not generating the correct query

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Postman app
  2. Select or generate a graphQL request that has this following template
query {
  object {
    field
    field
  }
}
  1. Click on Code
  2. Search for any Nodejs - Requests
  3. Select it
  4. See the generated Nodejs code snippet

Expected code snippet and corresponding request
GraphQL request should be able to support multi-line query

Screenshots

image

Additional context
A quick fix for this would be adding multi-line character instead of quote character on sanitize body request

@karmanya007
Copy link

@HuyNVuong Isn't this the correct code?

gQL_nodejs

For this request

gQL_nodejs_req

@HuyNVuong
Copy link
Contributor Author

HuyNVuong commented Oct 24, 2020

@karmanya007 That is correct, but the code would not compile if run locally?

@HuyNVuong
Copy link
Contributor Author

This issue is resolved at #339

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
3 participants