warrenday / graphql-network-inspector

A better network inspector for viewing and debugging GraphQL requests.
MIT License
466 stars 46 forks source link

Response/Request headers `Copy` Button #69

Closed tomma5o closed 3 months ago

tomma5o commented 2 years ago

Hey @warrenday, happy to be here again 😄


Is your feature request related to a problem? Please describe. When inspecting Queries/Mutations and want to copy headers of that call for using it in the GQL playground, it copies in the clipboard an array of headers that is the wrong format for the playground because it requires an object

Describe the solution you'd like The copy button copies an object not an array of values

Additional context Screenshot 2022-05-28 at 18 41 36

Happy to open a PR for this if u think it could be a good idea, dunno what was the reason for that choice, maybe postman &co. prefer that format!

WDYT?

warrenday commented 2 years ago

Hello again!

Happy to change the format of this although I wouldn't want to change how it works for users who are happy with the current format.

We could potentially make this a configuration option so users can choose which format headers are copied as.

Potentially the button could have a dropdown option to copy as array or copy as object.

Something along those lines?

tomma5o commented 2 years ago

Yep, I agree. Honestly, I prefer the dropdown in the button.

I think it's the fastest way because we don't have a configuration file AFAIK in the chrome-extension.

warrenday commented 2 years ago

Agree dropdown as part of the button would be much easier. Adding a config section may be overkill at the moment.