-
Notifications
You must be signed in to change notification settings - Fork 257
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
Apollo Federation - How to share customized types between services, except scalar types and enum #2571
Comments
If the type definitions are identical could we work around that slice of issues by simply discarding the duplication in a pre-processing step before the schema merge? If types are not identical would it be possible to resolve this by namespacing when they collide within the Gateway? i.e.: Gateway transforms |
Thinking about this more... Is the current intention to just mark the duplicated types in Service B as stub types? We'll still have an issue with |
This feature is available from apollo-server v2.8.0. Docs is updated: https://www.apollographql.com/docs/apollo-server/federation/core-concepts/#value-types.
|
@dredl is it possible to detail how this is expected to work in a microservice continuous deployment model? e.g. if service B requires a change to the type definition, should service A be redeployed? |
We're currently running into a similar issue. It could very much be us misusing the federation/tooling. Each one of our federated services declare an identical copy of an Enum. We have to perform an Apologies in advance if this issue is due to the misuse of Apollo Federation! Has anyone been able to resolve this? Thank you for your time. |
@dredl I think that only works for scalars and unions, not for types I'm trying to migrate some fields and types from one service to another. But I'm unable to do so as I get this error:
for each field in the type, even if the type is the same 🤔 oh and at the end:
Edit, my bad, one field was missing in one of the services, seems to be ok now :) |
This is really disappointing, even value types. From the docs it looks like subgraph's are can correspond to different microservices. Ideally it's nice that there will be a consistent |
For anyone who's still interested in this and hasn't kept up with the changes, I encourage you to check out the changes that came with Federation 2.0+. I suspect all of the concerns in here have been resolved, but if not please open a specific issue in the federation repo for the functionality you're looking for. |
I have two services, there are some types and inputs to share:
When i federate them use
apollo-gateway
, i got errors like:There can be only one type named "Page".
,There can be only one type named "PageInfo".
What can i do? Is this method is wrong?
The text was updated successfully, but these errors were encountered: