federation router, schema first and federation subscirpitoins questions :) #2178
-
HI all; I have a monolitic graphql-java implementation (schema first, not using smallrye gql).
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
It's currently only for the subgraphs, and I'm not aware of any GraphQL Federation Router written in Java. @phillip-kruger and I started Feder, but we didn't find the time to push it forward from the initial, PoC state. But why would you base your choice of a router on the programming language? It could be helpful for a migration, when you extract GraphQL code without Federation support into separate Federation enabled services. But when done, you should be free to switch to any other Router.
Yes. I'm sure you are aware, that this a long discussion 😁. I'm personally not the biggest fan of the idea to generate code from a schema, probably because I did too much SOAP in the past 🤪 And writing the schema and the code by hand, is not very productive. I prefer to define my domain logic, and then just sprinkle it with a pinch of annotation fairy dust. If you take client-first seriously, I'd go all the way and go for Consumer Driven Contracts (maybe even with WunderBar... sorry for pitching my own stuff again).
I've never used it, yet, but if the Router supports it, it can even federate the types from the substription. See this example |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Personally, I came across a router for graphql written in java. But it was not fully completed, had bugs, and did not support federations (it could only unite completely different subgraphs). I don’t think there is a production ready solution in Java, but I could be wrong. If you need a completely open source routing solution, I might suggest wundergraph cosmo (used in production). Quite a mature solution, but still evolving. There is also, for example, the guild hive, which is also not a bad solution.
Only code first. It may not be a familiar transition, but in many places it's worth it. Although in the federation, if you do very strange things, it can be painful, you will have to fi…