New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken React-Apollo example #121
Comments
@sinisterra When we see In regards to your error with |
@fbartho No, I'm running exactly the same query from the example, the |
it's not only about the broken example! I think this issue is very critical. The same issue is happening in safari and firefox.. I totally dont get it tbh.. the same version of my application was working fine since May24. it is only happening with requests I do with apollo-link-rest, although I've configured my customFetch fn, which is working. ¯_(ツ)_/¯ I am also getting the same error when i remove my |
I actually found the issue. my quick fix for my custom fetch function since I am not using credentials is the following: export function fetchWithAuth(url, options = {}) {
// this fixes apollo-link-rest providing credentials: null options
const { credentials, ...opt } = options
return fetch(url, getOptions(opt));
} |
I was also banging my head against the wall, getting "Network Error: Failed to Fetch" preventing the query from even executing with apollo-link-rest. @JuHwon is right, this appears to be tied to the credentials option on the RestLink constructor. While formerly it worked as optional per the documentation, I now can only get it to work after including the option like so: const restLink = new RestLink({
uri: ${process.env.REACT_APP_API_URL}/,
credentials: 'same-origin', // eg. or credentials: 'omit', etc
}); |
…eiving null Based on Comments in #121
Should be fixed in v0.3.1 -- now available! |
Hello:
I'm just getting started with
apollo-link-rest
with the basic configuration in yourreact-apollo
codesandbox.Instead of displaying the tv show list, the interface shows the following error:
: Network error: Failed to execute 'fetch' on 'Window': Invalid credentials mode
.When replicating that code in my own
create-react-app
environment, I also caught the following error when running a request on Apollo DevTools:Thanks a lot for your work on this link! It makes working with REST much more manageable by bringing GraphQL-like features for those of us stuck with REST APIs.
The text was updated successfully, but these errors were encountered: