tomitrescak / apollo-connector-mongodb

Apollo Connector for MongoDB with caching
24 stars 3 forks source link

Shouldnt DataLoaders only exist for the request length? #3

Open mikecann opened 5 years ago

mikecann commented 5 years ago

I am just reading up on DataLoaders and in the readme (https://github.com/graphql/dataloader) it mentions:

Avoid multiple requests from different users using the DataLoader instance, which could result in cached data incorrectly appearing in each request. Typically, DataLoader instances are created when a Request begins, and are not used once the Request ends.

As far as I can tell however, this lib seems to have Entities and thus the DataLoaders within them hang around for the lifetime of the application? Does this mean that that this then becomes an application level cache? What happens if you have more than one web server?