Giter VIP home page Giter VIP logo

Comments (3)

trevor-scheer avatar trevor-scheer commented on August 28, 2024

In AS4 there's no longer any magic around how data sources are created. In v3 as you've pointed out, the server cache (and context) were shared with your data sources automatically.

The migration guide explains how to replicate this old behavior if you like:
https://www.apollographql.com/docs/apollo-server/migration/#datasources

Does that approach fix the issue for you?

I'm not sure the caching docs that you linked to need to concern themselves with RESTDataSource. Maybe the README should mention the cache configuration option and show the migration path?

from datasource-rest.

dycor avatar dycor commented on August 28, 2024

The caching docs it's not up to date because if I only do what it says, the caching doesn't work

import Keyv from "keyv";
import { KeyvAdapter } from "@apollo/utils.keyvadapter";

const server = new ApolloServer({
  typeDefs,
  resolvers,
  cache: new KeyvAdapter(new Keyv("redis://user:pass@localhost:6379")), 
});

I have to do the behavior in https://www.apollographql.com/docs/apollo-server/migration/#datasources
Thanks for the response

from datasource-rest.

trevor-scheer avatar trevor-scheer commented on August 28, 2024

@dycor right. What I'm saying is: the article you're linking to is not specific to RESTDataSource (or any data source for that matter). That article pertains to configuring the server's cache. If you choose to share that cache with data sources, that's a different concern. Maybe something we could document here?

from datasource-rest.

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.