[feature]: GraphQL environment variables support and should be shared with REST
Is there an existing issue for this?
- [X] I have searched the existing issues
Summary
Add environment variables for GraphQL:
- in the GraphQL endpoint
- In the GraphQL variables editor
- In the GraphQL Headers editor
- In the GraphQL Authorization editor
And the environment variables should be shared with REST tab.
So that I can first request a REST api to get authorization information, and store tokens and other values in the environment variables, the the GraphQL requests can use those variables.
Why should this be worked on?
Get the GraphQL editor in hoppscotch more user friendly.
I would also add that environment variables should be shared with the team like collections. Otherwise, your team collections won't work because the requests are using variables that only you have access.
Yes, we must allow environments to extend to other environments.
Env1 <--extends-- Env2 <--extends-- Env3
Env1, Env2, Env3 may or may not be at the same level (team, connection, request).
We are working on revamping the GraphQL page completely. Should be done by next month hopefully. We will consider this feature at that point.
As for extending, we are brainstorming a UX for request based variables.
Yes. Environments should be tied to collections or teams... Also GraphQL and Websockets should be part of collections or part of teams / workspaces and they should support the same Environments and have collections in that workspace / team
Can't switch from Postman yet because of this issue.
So far, Hoppscotch is cool. I would try to contribute as well.
Are there any updates to this feature? It would be so cool if this feature was added.
This is basically the only feature needed before I can totally ditch Postman. Any news on this? What's the best way to help?
I'd say that environments should be global (same environments available to REST/graphql/realtime) as:
- There are usually some web services which have at least 2 of those 3 things
- Sharing a single config file per environment per team is easier/creates less friction than sharing a config file per environment per service per protocol per team
As for me personally it's an important feature, I'd gladly switch from insomnia to hoppscotch (and promote it to teammates) if it was not for the absence of configs I'm up to help in case
Same here, was excited to transition our teams to Hoppscotch from Insomnia and hit this road block soon after setting up our second collection
Any updates?
@AndrewBastin I guess the original plans have been thrown over?
Alternatively, if this takes too much time, maybe a good golden path for a fast solution is to do it how postman integrated it, by offering a graphql option on the REST tab for body format.
This is the only feature that stops me from fully migrating to hopscotch 😢
This is the only feature that stops me from fully migrating to hopscotch 😢
same
What is the current status of this issue? Are you open for PR's or is there something already in progress?
I am currently working on adding this feature! I've been waiting for this to be added for a long time as well as I do like Hoppscotch but this lacking feature really killed my intend to use it. I will be trying to get the GraphQL side of Hoppscotch a bit more polished up as I do intend to use it as my new tool.
Testing this feature on the branch I created would be lovely! Suggestions are welcome as well!