jaydenseric / graphql-react

A GraphQL client for React using modern context and hooks APIs that is lightweight (< 4 kB) but powerful; the first Relay and Apollo alternative with server side rendering.
https://npm.im/graphql-react
MIT License
717 stars 22 forks source link

How to override Fetch to do normal fetch request ? #27

Closed revskill10 closed 5 years ago

revskill10 commented 5 years ago

I'm overriding Fetch options to query from REST API. My options is

const dspaceOptions = {
    url: 'https://jsonplaceholder.typicode.com/todos/1',
    headers: {
      'Content-Type': 'application/json',
      method: 'GET'
    }
  }

But i got error fetch error in cacheValue. In some cases, my API is from a legacy REST server and i'd love to use this library to do the fetch also.