apollo-feature-requests
apollo-feature-requests copied to clipboard
[Feature Request] Make (federated) service introspection optional for serverless applications
In serverless applications, introspection is quite an overhead and as of now, this step is required to build a schema for the gateway.
What We do now to work around it (with the old schema stitching) is to pull schemas at build time and ship the services' schemas with a new deployment of the gateway.
This has become a bit more tricky with Apollo Federation, but is still possible to some degree by specifying these schemas as local services (localServiceList
) and a custom data source to control how to communicate with the external endpoint(s).
I'd suggest some way to override @apollo/gateway
's initialization behavior with some serverless functionality that may be used by Azure-, cloud- and Lambda functions to supply schema and endpoint without having to communicate with each federated service, individually.
On top of that, we also use custom directives to supply authorization at the gateway-level (#2778) (then usable at the service-level) - and there's currently no way to supply custom directives with the federation feature which makes schema validation fail using localServiceList
.
@martinjlowm support for this is being implemented (and documented) via #2945! I'm going to move this to our feature request repo but it should be possible soon!
@jbaxleyiii i've had a poke around but no luck. do you know where i can find the documentation for this? cheers
Hi any update on this :)
Hi, I may have found a workaround with the supergraphs although it doesn't seem production ready yet.
See my explanations here: https://github.com/mugtaba-subahi/serverless-apollo-federation/issues/11#issue-928547840
I will try it in a real-world app soon. Will tell you how it goes.
PS: if any guys working on the supergraph feature sees this post, I'd be happy to understand what's your release plan for it :)
This is the default workflow for router + rover, and can be accomplished in @apollo/gateway
using SupergraphManager
s