Giter VIP home page Giter VIP logo

Comments (3)

ardatan avatar ardatan commented on May 22, 2024

DataSources feature looks quite similar to providers while providers feature is part of Dependency Injection and can be connected to each other in modular approach. And providers are constructed in application scope, not in request scope while DataSources are created inside a factory function on each request. But you can call providers inside datasources by using injector inside context, or get datasources inside providers by using onRequest hook inside of providers.
We can think about request scope providers. What do you think @dotansimha @darkbasic @kamilkisiela?

from graphql-modules.

dotansimha avatar dotansimha commented on May 22, 2024

That's a great questions, @nathanchapman !
@ardatan is right, DataSources of apollo-server is similar to Providers in graphql-modules.
Actually, before we started to develop graphql-modules, we used DataSources in some of our projects.
DataSources is great as a simple bridge for your data, it's an abstraction that prevents from your resolvers to access directly the data source.
The problem is that each DataSource stands by itself, and they cannot interact with each other easily, and Providers can interact and communicate with other Providers with dependency-injection.

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024

Then I am planning to create a PR about request scope providers.

from graphql-modules.

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.