hoppscotch icon indicating copy to clipboard operation
hoppscotch copied to clipboard

[feature]: GraphQL environment variables support and should be shared with REST

Open xpol opened this issue 4 years ago • 18 comments

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.

xpol avatar Mar 17 '22 10:03 xpol

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.

jopijuco avatar Mar 18 '22 17:03 jopijuco

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).

xpol avatar Mar 19 '22 01:03 xpol

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.

AndrewBastin avatar Mar 21 '22 04:03 AndrewBastin

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.

tobychidi-zz avatar Mar 28 '22 08:03 tobychidi-zz

Are there any updates to this feature? It would be so cool if this feature was added.

hiroingk avatar Aug 17 '22 00:08 hiroingk

This is basically the only feature needed before I can totally ditch Postman. Any news on this? What's the best way to help?

whoistobias avatar Nov 17 '22 17:11 whoistobias

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

Mautriz avatar Dec 12 '22 01:12 Mautriz

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?

camflan avatar Apr 11 '23 19:04 camflan

@AndrewBastin I guess the original plans have been thrown over?

wzrdtales avatar Jul 01 '23 22:07 wzrdtales

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.

wzrdtales avatar Jul 01 '23 22:07 wzrdtales

This is the only feature that stops me from fully migrating to hopscotch 😢

azzamsa avatar Aug 06 '23 01:08 azzamsa

This is the only feature that stops me from fully migrating to hopscotch 😢

same

camflan avatar Nov 14 '23 16:11 camflan

What is the current status of this issue? Are you open for PR's or is there something already in progress?

p-kuen avatar Nov 22 '23 08:11 p-kuen

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!

Timeraa avatar Jan 06 '24 01:01 Timeraa