altair: JS error when trying to send a request

Describe the bug

I’m using Altair to send a simple GQL request to my local server and getting a JS error. DevTools doesn’t show any HTTP requests when I click “Send request”

To Reproduce

I send POST request to http://localhost:3011/graphql, I have a custom header `Authorization: Bearer …jwt token…", the query is

query {
  users {
    id
    name
  }
}

I have more types/queries available, all of them have documentation in the Altair, but I can’t get any of them from the server.

Expected behavior

To get a response back.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version 67.0.3396.79

Additional context

The trace that I’m getting:

ERROR TypeError: Cannot read property 'trim' of null
    at main.a34c97150364002f3b7f.bundle.js:1
    at Array.filter (<anonymous>)
    at e.sendRequest (main.a34c97150364002f3b7f.bundle.js:1)
    at Object.handleEvent (main.a34c97150364002f3b7f.bundle.js:1)
    at Object.handleEvent (main.a34c97150364002f3b7f.bundle.js:1)
    at Object.handleEvent (main.a34c97150364002f3b7f.bundle.js:1)
    at Kr (main.a34c97150364002f3b7f.bundle.js:1)
    at main.a34c97150364002f3b7f.bundle.js:1
    at t.object.i [as _next] (main.a34c97150364002f3b7f.bundle.js:1)
    at t.__tryOrUnsub (main.a34c97150364002f3b7f.bundle.js:1)

I understand that it points to lines in the minified bundle, please, let me know if you need more info.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 45

Most upvoted comments

Challenge accepted

Yeah I noticed that too. I guess it wouldn’t be an easy PR afterall.

@imolorhe I’ll get back to you with a PR in a few hours

Aha! 😄

@imolorhe This is the error i get when clicking Send Request:

main.24b63ef02289e949e08e.js:1 ERROR TypeError: Cannot read property 'trim' of null
    at main.24b63ef02289e949e08e.js:1
    at Array.filter (<anonymous>)
    at t.project (main.24b63ef02289e949e08e.js:1)
    at t._next (main.24b63ef02289e949e08e.js:1)
    at t.next (main.24b63ef02289e949e08e.js:1)
    at t._tryProject (main.24b63ef02289e949e08e.js:1)
    at t._next (main.24b63ef02289e949e08e.js:1)
    at t.next (main.24b63ef02289e949e08e.js:1)
    at t._next (main.24b63ef02289e949e08e.js:1)
    at t.next (main.24b63ef02289e949e08e.js:1)

I think it’s fine as it is. Thanks a lot for Altair!