Giter Site home page Giter Site logo

Comments (6)

dillonkearns avatar dillonkearns commented on August 18, 2024

Hey @rofrol thanks for reporting the issue and for the all the details.

Graphqelm appears to be handling that response as I would expect. The response is telling it that there is an error, and the fact that the actual response is nested in there means that Juniper is capable of generating the response, but as far as the client (Graphqelm) is concerned, it has no way to know to find the response there. So as best I can tell, this appears to be an issue with Juniper. Or perhaps there is some header or something that needs to be passed to make Juniper happy? It is surprising because it understands the request based on the fact that it actually gives the response. And it doesn't give any details of the error.

I'm not really sure what to do with this on my end as it appears to be handling it properly on the Graphqelm side. Could you try to figure out why it's sending the response back nested under error? Perhaps you could file an issue on the Juniper or actix-web repo? I'd be happy to help if there's an issue on the Graphqelm-side but as far as I can understand there doesn't appear to be. Thanks!

from elm-graphql.

rofrol avatar rofrol commented on August 18, 2024

That's strange, because downloading schema with fetch-graphql-schema or the code I've created https://github.com/rofrol/fetch-graphql-schema-custom, works.

from elm-graphql.

rofrol avatar rofrol commented on August 18, 2024

Headers received from juniper when running query inside chrome dev tools console:

HTTP/1.1 200 OK
content-length: 157
content-encoding: br
date: Sun, 01 Apr 2018 13:11:29 GMT

When used cross-fetch, encoding set to gzip.

from elm-graphql.

rofrol avatar rofrol commented on August 18, 2024

I think this is the issue:

  if (contentType && contentType.startsWith('application/json')) {
    return response.json()
  } else {
    return response.text()
  }

https://github.com/graphcool/graphql-request/blob/9e689c94e5d90b3a238a1386b92a27bc96d8c20d/src/index.ts#L120

because it may be content-encoding: gzip

from elm-graphql.

rofrol avatar rofrol commented on August 18, 2024

Closing in favor of jasonkuhrt/graphql-request#70

from elm-graphql.

dillonkearns avatar dillonkearns commented on August 18, 2024

Interesting, thanks for investigating @rofrol! Keep me posted, I'm curious to see how this gets resolved.

from elm-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.