Dynamic route-separated ApolloServer instances #4391
Unanswered
mgagliardo91
asked this question in
General
Replies: 1 comment
-
Hi @mgagliardo91, Did you find any solution to this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a project where I would like to schemas separated by organization and host an organization-specific ApolloServer instance at a route prefixed by the organization name.
For example, the route
/api/:organizationId/graphql
would surface an ApolloServer instance with a schema specific to the organization matching:organizationId
. I am currently using apollo-server-express, however, it requires having a route to apply its middleware ahead of time, rather than dynamically.Ultimately, I would imagine an architecture where when a request comes in for a specific organization, I would initialize an ApolloServer instance with the org-specific schema, cache it, and reuse it for subsequent requests to the same org-prefixed route.
Has anyone done anything similar to this and, if so, how would I best implement this with ApolloServer in node/express?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions