Replies: 1 comment 1 reply
-
The plugin sends data for the gateway not for the services. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Heya! Hope you're all doing amazing!
I am not quite sure if this is a bug, or a case of misconfiguration (either on Hive or Mesh), so I'm starting here first and if it's a legitimate bug then I can move it to an issue in the appropriate place.
Backstory
My company is exploring replacing Apollo with a full GraphQL guild stack (your stuff is dope!). As a part of this I have been working on a PoC locally with GraphQL Mesh and Hive. I have been following the guides here and here to integration the two.
Context
I have a Hive instance running with an external composition server to handle Apollo Federation and a project defined as an Apollo Federation project. All schemas I've published are federation compliant and are successfully published and visible inside my Hive instance. Some of the schema types in the two published schemas are resolved across both graphs (i.e. a User type in subgraph A has a field resolved in subgraph B). I have configured my Mesh instance to talk to the local services serving these schemas at the same addresses and ports defined in Hive. Here is my Mesh configuration (anonymized):
Problems
The traffic is getting to the running services, but the resolution is not happening correctly. For example, if service A serves type User and there's a field inside of that definition resolved against service B, it sends all traffic to service A and not to the correct service B (merging the result and sending that as the response). From debugging I think this is because each of the services in the Mesh configuration are referring to the composed federated schema inside Hive, so Mesh cannot differentiate where to send the traffic correctly. I looked at the CDN documentation for Hive, and couldn't find a way to get an individual service's schema in the federation case so that I could point to the specific schema in the Mesh configuration. I know you can get all services and the SDL for each one, but it felt a bit hacky to try and do that in the configuration instead of a direct API call. As far as I know I shouldn't have to use federation transforms as it's already federation compliant but is that wrong?
The second problem is metrics are not ending in the Hive instance as expected, but I think this may be related to the first problem because traffic isn't getting to the services correctly or I need to include the plugin in our services to publish metrics to Hive (this seems likely).
Has anyone tried running Mesh + Hive for pure Apollo Federation and gotten schemas to resolve across multiple services correctly with the expected merged result? Does my configuration look wrong? Happy to provide any more detail! Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions