apollo-server icon indicating copy to clipboard operation
apollo-server copied to clipboard

Move `apollo-datasource-rest` to its own repository

Open glasser opened this issue 3 years ago • 5 comments

apollo-datasource-rest is a caching HTTP client for Node which uses our apollo-server-caching interface to talk to a cache. Other than the fact that it implements the DataSource interface, its code is pretty unrelated to the rest of Apollo Server, and the current Apollo Server team has not been actively maintaining it, despite the fact that it's a nice piece of software that many find valuable.

Its version numbering is not particularly related to Apollo Server’s version number (as it is essentially unrelated code and backwards-incompatible changes to one package generally won’t cause backwards-incompatible changes to the other) but it is currently coupled to the Apollo Server release process: we can’t easily release it without releasing AS and vice versa, and its CHANGELOG is confusingly intermingled with Apollo Server changes. (These are certainly fixable problems if we wanted.)

Because it is semantically pretty independent from Apollo Server, we will move it to its own repository with its own CHANGELOG and issue tracker. We will also start actively maintaining it again, in collaboration with community members who use it more than we do internally at Apollo.

(Like the rest of Apollo Server, we will change it to use keyv instead of apollo-server-caching.)

glasser avatar Jan 26 '22 18:01 glasser

Also rename to @apollo/

glasser avatar Jan 26 '22 18:01 glasser

As suggested in https://github.com/apollographql/apollo-server/issues/6048 we should make sure the documentation for the class is complete. We should decide if we want to canonical docs to be the README or the page in the Apollo Server site, and make sure all options are documented there.

glasser avatar Jan 28 '22 23:01 glasser

Note that some of its tests lived in

packages/apollo-server-core/src/__tests__/dataSources.test.ts
packages/apollo-server-express/src/__tests__/datasource.test.ts

etc

so recreate the integration tests from these files in the new repo!

glasser avatar Feb 04 '22 23:02 glasser

As part of moving it, we should update it to be compatible with AS4 instead of AS3. Ideally this will involve having zero dependencies on Apollo Server (existing dependencies can change to dependencies on @apollo/utils.fetcher, @apollo/utils.keyvaluecache, graphql, etc); stop depending on and implementing the DataSource interface; and move the initialize method's contents to the constructor.

glasser avatar Jul 22 '22 18:07 glasser

@glasser just want to note that I looked at both of those test files and neither really applied.

The first doesn't pertain to RESTDataSource, mostly applies to the dataSources config option and initialization of DS'es. The second, again not sure if it really applies. I did add an integration test to make sure it's usable via AS context 🤷

trevor-scheer avatar Aug 09 '22 01:08 trevor-scheer