Comments (3)
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.
That's a great questions, @nathanchapman !
@ardatan is right, DataSources
of apollo-server is similar to Provider
s 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 Provider
s can interact and communicate with other Provider
s with dependency-injection.
from graphql-modules.
Then I am planning to create a PR about request scope providers.
from graphql-modules.
Related Issues (20)
- RangeError: Maximum call stack size exceeded HOT 8
- Subscription middleware contains only injector HOT 1
- update subscription docs
- Headers info doc HOT 1
- ERR Error: Error during instantiation of BasicProvider
- Error context.ɵgetModuleContext is not a function HOT 1
- Prepare for Typescript 5.0 compatibility HOT 1
- Cannot override Apollo Server's default field resolvers HOT 1
- Typescript 5 support HOT 1
- Enum data type resolves aways as null HOT 1
- Unable to test custom scalars HOT 3
- Feedback for “Migration from v0.X” HOT 1
- Can't use TS typedefs on an ESM setup HOT 7
- Updates to context are not propagated to all operational providers HOT 2
- Map Providers / Interface Providers / Array Providers
- Sharing a single provider instance between multiple Injection Tokens
- Allows modules to not provide any type definition if they provide at least one provider
- Passing a `Module` reference to module throws Error
- Using instanceof for external libs(graphql) is dangerous
- Package types is not being resolved in a TS setup when `moduleResolution` is `bundler` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-modules.