Pluggable / disabled documentStore #5634
Unanswered
owenallenaz
asked this question in
Ideas
Replies: 1 comment 9 replies
-
What are the differences between your ApolloServers? Do they share the same schema? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@glasser This originates from #5629 where there was discussion about making the
documentStore
pluggable. Before I submit a PR I would like to finalize the design of the feature to make sure we're on the same page.Current Problem
This is what we're doing in our application now, it's dirty, and reaching into the private variables of
ApolloServer
and I'd rather not, but it's a neccessity because we have 20 ApolloServers that largely share query signatures running in the same Node process.The
sharedDocumentStore
is initialized early in the App, and then we hit code where we loop and build our 20 ApolloServer's.In this case, I'm swapping out the internal private variable so that we can re-use the store for all of our servers. Again, it's dirty, and I'd rather not.
Proposal
The contract I was looking to change, and seems pretty easy to change in the code is something like:
With the config argument
documentStore
accepting a more pluggable storage definition in TypeScript like:Then we'd do a small alteration in
generateSchemaDerivedData
where we use the passed documentStore or we initialize the default.There is a comment in the code indicates that there was possibly a desire to disable the documentStore
This cannot currently be disabled.
If that's the case, it's possible that we could dodocumentStore : PluggableDocumentStore<DocumentNode> | boolean
and if it's false make the code updates needed to effectively skip the pathway. The assumption being thatundefined
ortrue
means use the default,false
means no store, or a passed in value means use the passed in value.I can submit a new PR with the changes once we decide on the design you think is appropriate.
Beta Was this translation helpful? Give feedback.
All reactions