Giter Club home page Giter Club logo

Comments (3)

jbaxleyiii avatar jbaxleyiii commented on May 18, 2024

@arackaf the fetcherOptions => fetchOptions will be fixed with the next release! (0.9.0). I also added a test to ensure that both the setup options and the context options could set the method of requesting.

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 a link property in its options anywhere.

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

from apollo-link.

arackaf avatar arackaf commented on May 18, 2024

@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 :))

from apollo-link.

peggyrayzis avatar peggyrayzis commented on May 18, 2024

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!

from apollo-link.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.