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

feature request #565

Closed
Noor0 opened this issue Aug 9, 2017 · 4 comments
Closed

feature request #565

Noor0 opened this issue Aug 9, 2017 · 4 comments

Comments

@Noor0
Copy link

Noor0 commented Aug 9, 2017

wouldn't it be great to be able to

  • add request headers.
  • view response headers.
  • create and set environment variables.
@wincent
Copy link
Contributor

wincent commented Aug 9, 2017

Thanks for your feature request!

Please see #500 for most recent discussion around setting request headers. For visualizing response headers, are the Chrome dev tools sufficient for your needs? For "environment variables", I am not even sure what that means in the context of GraphiQL (it's just a React component), but the answer is likely the same: you can configure it with an arbitrary fetcher function, but GraphiQL itself has no business knowing or caring how you transport data to and from the schema; if you care about that you should be able to get pretty far by composing GraphiQL within your React UI, and doing whatever you want/need in your custom fetcher.

Closing this for now, but feel free to comment again if you have further questions/thoughts etc.

@wincent wincent closed this as completed Aug 9, 2017
@AlexanderChen1989
Copy link

AlexanderChen1989 commented Sep 12, 2017

@wincent We just want a easy way to test api! Why you ignore that?

@asiandrummer
Copy link
Contributor

asiandrummer commented Sep 14, 2017

@AlexanderChen1989 I'm sorry if our responses felt like that, but I just want to make sure we're not ignoring your requests. In #500, I listed a couple of options that you can look into if you really wanted setting custom headers:

Hopefully those options fulfill your needs. @wincent has again made a great explanation as to why we wouldn't want the custom header feature in GraphiQL, so I'll avoid being repetitive here.

About environmental variables, in which cases would you need to use env vars? What would you like to configure/customize, and how would the env variables help? If you're using our example code to fire up a GraphiQL instance to test your queries, then you should be able to alter the server code however you need to solve your use case. If you're embedding GraphiQL as a standalone React component, then there should be a far more freedom for you to do whatever/however you wanna do. Please let us know if we're misunderstanding something.

@imolorhe
Copy link
Contributor

imolorhe commented Feb 3, 2018

@AlexanderChen1989 You can also checkout https://github.com/imolorhe/altair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants