postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.82k stars 838 forks source link

curls copied and imported of graphql over http are not importing correctly. #12349

Closed mmcguff closed 7 months ago

mmcguff commented 1 year ago

Is there an existing issue for this?

Describe the Issue

When you copy a curl of a http POST request where the body type is graphql, the curl generated is unable to be imported back into postman without throwing an error. Here is short gif of the issue:

Steps To Reproduce

  1. Start with any graphql request over http. In the example I am using the unauthenticated SpaceX graphql API.

  2. Ensure the call is working.

  3. copy the curl of the working request using the snippet option in postman

  4. Import that copied curl and see that running that once running request fails with a parsing error of some kind.

The error looked like this:

{ "errors": [ { "message": "Unknown operation named \"\".", "extensions": { "code": "OPERATION_RESOLUTION_FAILURE" } } ] }

Below is the postman generated curl which will not import correctly:

curl --location 'https://spacex-production.up.railway.app' \
--header 'Content-Type: application/json' \
--data '{"query":"query getCompanyData {\r\n    company {\r\n        ceo\r\n    }\r\n}","variables":{}}'

Screenshots or Videos

postman-graphql-over-http-import-issue

Operating System

Windows

Postman Version

10.18.6

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

The issue in postman web appears slightly different but it still doesn't work.

Having CURL fail like this is big deal for my API Documentation development. DX (Developer Experience) is a big deal for use case of postman for API Documentation. If this issue is not resolved right away, I will be forced to use another provide for my API Documentation needs.

VShingala commented 1 year ago

@mmcguff Thanks for reporting the issue! We are working on the fix for this and will inform here once this is fixed.

jnorrisdod commented 10 months ago

Is there a fix for this yet? Having this issue and PM says "You are up to date! Postman v10.20.10 is the latest version."

VShingala commented 7 months ago

@mmcguff @jnorrisdod This issue has been fixed with the latest release v10.22. I've also confirmed it to be working as expected. Feel free to open this thread if you face any further related issue.