Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 00:04
    greenkeeper[bot] commented #1166
  • Jan 21 23:46

    greenkeeper[bot] on start-server-and-test-pin-1.10.6

    fix: pin start-server-and-test … (compare)

  • Jan 21 23:46
    greenkeeper[bot] labeled #1166
  • Jan 21 23:46
    greenkeeper[bot] opened #1166
  • Jan 21 23:30

    greenkeeper[bot] on start-server-and-test-1.10.7

    chore(package): update start-se… chore(package): update lockfile… (compare)

  • Jan 21 10:15
    stale[bot] closed #307
  • Jan 21 08:29
    imolorhe commented #1154
  • Jan 20 14:53
    Sam-Kruglov closed #1165
  • Jan 20 14:53
    Sam-Kruglov commented #1165
  • Jan 18 17:39
    Sam-Kruglov commented #1165
  • Jan 18 16:59
    imolorhe commented #1165
  • Jan 18 16:31
    Sam-Kruglov commented #1165
  • Jan 18 16:12
    imolorhe commented #1165
  • Jan 17 11:27
    terion-name commented #1154
  • Jan 17 11:26
    terion-name commented #1154
  • Jan 16 12:24
    Sam-Kruglov edited #1165
  • Jan 16 12:23
    Sam-Kruglov commented #1165
  • Jan 16 12:23
    Sam-Kruglov edited #1165
  • Jan 16 12:16
    welcome[bot] commented #1165
  • Jan 16 12:15
    Sam-Kruglov opened #1165
Samuel
@imolorhe
@marlini-rd that looks correct to me
Didn't it work?
marlini-rd
@marlini-rd
no
Samuel
@imolorhe
Checking..
marlini-rd
@marlini-rd
ok, this always set an empty string
Samuel
@imolorhe
window['ALTAIR_INITIAL_PRE_REQUEST_SCRIPT']
Sorry the markdown is spoiling the format
window['__ALTAIR_INITIAL_PRE_REQUEST_SCRIPT__']
marlini-rd
@marlini-rd
ok, let me check that
Samuel
@imolorhe
Also when you use that, also open a new window to confirm it.
Altair wouldn't set the value in an already existing window
marlini-rd
@marlini-rd
works, thanks
another question, is it possible to do the same for the settings? I mean, have a variable for this
Samuel
@imolorhe
Yes. You would need to create an issue for that though.
emolex
@emolex

Hi, i would like to save token which I get from one of the method. Is it possible to save it in global variable?

My response looks like this:
{ "data": { "login": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlbGRlcmx5LWNhcmUuYXBwIiwic3ViIjoiZW1pbC5jemVyc2tpQGw0YS1zb2Z0LmN" } }

emolex
@emolex
@imolorhe
Samuel
@imolorhe
@emolex what do you mean by save?
If you need it for making requests, you can use the pre request scripts for that
There's a section on persisting data across requests
emolex
@emolex
I created in local environment a some json: {"token":"some token"}.
In my api, I have a method, which in response returned new token JWT
I want to save this new token in local environment called "token" and use it for example in next method and put it into Header as Authorization: Bearer token.
emolex
@emolex
This what I want is just save this new JWT into local environment ("token").
I know that its basics, but I tried do it by altair.helpers.setEnvironment and ltair.helpers.getEnvironment but it doesnt work
Samuel
@imolorhe
Using the setEnvironment only sets the data for that request
You can go through that page content and see what I mean
You can get the data and store it in local storage for example
For the next request you can read it from local storage
@emolex
Jeremy Gayed
@tizmagik
Anyone know if there's a way to programmatically set the initial environments ?
Samuel
@imolorhe
@tizmagik there is currently no way to set the initial environment.
I see you opened an issue so I'll give the reply there.
Jeremy Gayed
@tizmagik
Thanks @imolorhe ! Another question I had was around the ability to share a URL of the current query -- we implemented this ourselves in GraphQL Playground by laying over a button on the UI that would call redux actions/getters/setters that they exposed in their API to grab the current query and then on load to read in the URL and inject a new tab with that query. Would something like this be feasible in Altair ?
Samuel
@imolorhe
@tizmagik yes, but there are many questions to consider: what are the things that can be added to the shared URL, considering Altair offers a whole lot more features? When should the data be pulled from the URL, and should it be a new window in Altair if a user already uses Altair? What happens on subsequent visits, like if the user reloads the page with the URL still set?
Jeremy Gayed
@tizmagik
@imolorhe I can write-up an issue for this, but I think to support what we need it would be great if it could be done via externally available API, think something like: altair.getCurrentWindow() which would be called when the user clicks some button that we overlay on the UI that returns some object: { query, endpoint, environment, headers, variables } that we compress and/or URL-shorten as a sort of "deep-link" and then on page-load we can "inject" a new tab if the user loads with a given deep-linked URL, and we'd call altair.setCurrentWindow() with those same settings -- or even a series of commands like: altair.setCurrentEnvironment(); altair.createNewTab(); altair.setCurrentQuery() etc
Thoughts?
Jeremy Gayed
@tizmagik
In fact, a lot of the above API would already be available if the Redux store and the action creators/reducers were exposed externally. As an example, this is how GraphQL Playground currently does it and we were able to implement deep-linking functionality without any modifications to their internal API/code: https://github.com/prisma-labs/graphql-playground/blob/ae450c0d1bfc6f2b9e07a30824e0d3ffe992d71e/packages/graphql-playground-react/src/lib.tsx#L11-L30
Samuel
@imolorhe
@tizmagik How do you currently use Altair?
With the npm package for express or koa?
Samuel
@imolorhe
Adding a share button to Altair is the least problematic part. For URL shortening, I'd be curious to know what solutions exist. Currently I don't manage any backend systems for Altair that could handle the URL shortening functionality. Maybe it would be easier if you respond to each question separately, so we can discuss each of them without mixing things up :slight_smile: Or perhaps on a GitHub issue. (Unfortunately gitter doesn't support threads for such). Maybe I should move the chat to something else 🤔

what are the things that can be added to the shared URL, considering Altair offers a whole lot more features?

I assume you are suggesting this will be solved with URL shortening. My follow up question is what solutions exist that would work, for all environments (desktop apps, browser extensions, etc), and would it require a backend system we would have to manage?

When should the data be pulled from the URL, and should it be a new window in Altair if a user already uses Altair?

The reason I asked this question is because of the follow up question about subsequent visits (What happens on subsequent visits, like if the user reloads the page with the URL still set?). Altair persists the state of the app, even on subsequent visits. If the URL is still set, how do you prevent a new tab from being created everytime the user simply reloads the page, or opens the app again after a while?

Jeremy Gayed
@tizmagik
Good questions. Let me write up an issue so we can talk through more detail there
Samuel
@imolorhe
Awesome!
Jeremy Gayed
@tizmagik
And no, we don't currently use Altair, but are looking to move off of GraphQL Playground because it has become stale
Samuel
@imolorhe
Oh okay
Jeremy Gayed
@tizmagik
We're encouraged by what we've seen so far with Altair, you've done an amazing job!
Samuel
@imolorhe
Glad to hear. Thank you :slight_smile:
Jeremy Gayed
@tizmagik
@imolorhe wrote up an issue here: imolorhe/altair#1089 thanks for taking a look!
sumanthakannantha
@sumanthakannantha
The latest altar plugin is not working as expected. By default, for post calls, it is sending OPTIONS.
Samuel
@imolorhe
@sumanthakannantha What version of Altair?
What platform?