postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

add code snippets for graphql queries

Open kevinawoo opened this issue 2 years ago • 9 comments

Is there an existing request for this feature?

  • [X] I have searched the existing issues for this feature request and I know that duplicates will be closed

Is your feature request related to a problem?

No

Describe the solution you'd like

I would like to be able able to copy the graphql query to curl so it can be easily shared and ran in the terminal.

Describe alternatives you've considered

No other solution besides making the curl yourself.

Additional context

No response

kevinawoo avatar Jun 12 '23 23:06 kevinawoo

Hey @kevinawoo , Postman does support the cURL code snippet generation of requests with a Graphql body. You can copy and run the generated code snippet in your terminal or share it with your team.

Please take a look at the attached video which demonstrates the same.

https://github.com/postmanlabs/postman-app-support/assets/121886615/379e7186-b677-497f-9187-403cbdeb8a93

I hope this helps you to solve your query, If you have any further doubts, please feel free to ask 😄

aman-v-singh avatar Jun 20 '23 03:06 aman-v-singh

Oh I didn't know we could make a graphql request from a type HTTP request, thanks!

When I reported the feature request, I was using a type GraphQL tab. There's two ways I've made these types of requests before:

  • Using cmd+n to get the new tab: CleanShot 2023-06-20 at 10 35 02@2x

  • Changing request type from the dropdown: CleanShot 2023-06-20 at 10 40 25@2x

kevinawoo avatar Jun 20 '23 17:06 kevinawoo

Note, the GraphQL request type does not have the ability to export as curl

kevinawoo avatar Jun 21 '23 16:06 kevinawoo

@aman-v-singh, please, reopen

heckad avatar Jun 28 '23 18:06 heckad

Hey @heckad, Is there anything I can help you with?

aman-v-singh avatar Jun 29 '23 05:06 aman-v-singh

There is no code example in this configuration image

heckad avatar Jun 29 '23 09:06 heckad

@heckad We are tracking this issue internally and we are planning to add the code snippet support for graphql requests soon.

aman-v-singh avatar Jun 30 '23 07:06 aman-v-singh

@aman-v-singh big thank. Let's close this issue when code snippets will added.

heckad avatar Jul 01 '23 19:07 heckad

@aman-v-singh has this been implemented yet? can't seem to find it

tonyjmnz-ss avatar Mar 12 '25 15:03 tonyjmnz-ss