-
Notifications
You must be signed in to change notification settings - Fork 347
fetcherOptions.method not respected #153
Comments
@arackaf the
Looking at your sample code above, I think the issue is your apollo-client is missing a cache which is probably breaking all sorts of things. I'll add / throw a warning on the core client if link or cache is missing! I've added an issue to track that here |
@jbaxleyiii thanks so much! So if specifying a cache is more or less required, I'm curious why my code was working so well otherwise - my React components were caching queries perfectly. In any event, if I do need to specify a cache, is this what I need, in order to keep the same behavior I was seeing out of the box with React? import InMemoryCache from "apollo-cache-inmemory";
const client = new ApolloClient({
link: new HttpLink({ uri: "/graphql" }),
cache: new InMemoryCache()
}); Also, can you point me in the direction of the code where adding a link to the options of ApolloClient will work? I didn't see anything in there that accounted for a link property, but I'm sure I was looking in the wrong place. (I'm mostly just curious, if it's not too much trouble :)) |
Hi @arackaf! Sorry for the delay, we've been very busy with the new 2.0 release! Our recently released docs site should have the answers you're looking for. I'm going to close this issue since the original request was fixed, but please open a new one regarding docs if there's anything that we could make more clear! |
Intended outcome:
Use http GET verb for graphQL query
Actual outcome:
POST is used. Override is not respected
How to reproduce the issue:
The problem may be here, in httpLink.ts
options is overriding whatever I send in for requestOptions.fetcherOptions (also, your docs have this option incorrectly as fetchOptions https://github.com/apollographql/apollo-link/tree/master/packages/apollo-link-http)
But I can't verify this since the relevant part of
createHttpLink
never executes. It appears as though ApolloClient isn't even using it? ApolloClient doesn't appear to look for alink
property in its options anywhere. So depending on what's on options above, there may be two issues, though at the very least the client object does not use the link object I pass in.The text was updated successfully, but these errors were encountered: