denvned / isomorphic-relay

Adds server side rendering support to React Relay
BSD 2-Clause "Simplified" License
242 stars 53 forks source link

How to debug queries? #40

Closed chyzwar closed 8 years ago

chyzwar commented 8 years ago

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 ?

denvned commented 8 years ago

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.