New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor functions used in apollo-server and the router-bridge into apollo-utils #1841
Comments
@glasser maybe a good argument for making this a separate package, though exported by @o0Ignition0o can this not be imported as is right now? (I haven't dug to look more closely yet) |
Doing some spot-checking, it seems like a lot of the copypasta is exported already (e.g. https://github.com/apollographql/apollo-server/blob/d75c6cf3360a46ebcd944b2113438be8f549ae6f/packages/apollo-server-core/src/plugin/usageReporting/operationDerivedDataCache.ts#L5-L8) I'm wondering if this question came about because the rooter depending on |
Just spoke with @glasser about this and we actually already have a precedent for this. We recently moved a very similar signature function (operation registry) to its own package in ( |
yeah i believe the task is roughly:
|
This commit introduces a new `@apollo/utils.usagereporting` package which exports common bits of usage reporting code shared between apollo-server and router-bridge. Consequently, this also introduces and updates a couple other related packages: `@apollo/utils.removealiases` `@apollo/utils.stripsensitiveliterals` These transforms are used by `usagereporting` in order to derive the operation signature. For testing purposes, I've also introduced a snapshot serializer for printing GraphQL AST nodes. `@apollo/utils.jest-graphql-ast-serializer` Related: apollographql/federation#1841
During our recent work on the router-bridge we copy/pasted bits of code from apollo-server and refactored a bit as well.
It would be great if we could refactor this and use the same methods into apollo-utils
The text was updated successfully, but these errors were encountered: