denvned/isomorphic-relay

How to debug queries?

chyzwar opened this issue · 1 comments

I get some errors on prepareData

{ [Error: fetchWithRetries(): Still no successful response after 1 retries, giving up.]
  response: 
   Body {
     url: 'http://localhost:4000/graph',
     status: 400,
     statusText: 'Bad Request',
     headers: Headers { _headers: [Object] },
     ok: false,
     body: 
      PassThrough {
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _eventsCount: 7,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        _transformState: [Object] },
     bodyUsed: false,
     size: 0,
     timeout: 0,
     _raw: [],
     _abort: false } }

I guess that is because 400 is returned from graphql endpoint. How I can get string representing query?
How you could debug this ?

For example you can write a query logger on the GraphQL server or in a custom relay network layer. Or place a request logging proxy before GraphQL server.