Replies: 1 comment
-
Demo PR: #2270 |
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
-
Currently, I'm looking for a way to implement Ent and GQLGen with Micro-Services and Federations.
The feature that I really like about Ent is the support for the Relay Node API. But I can't implement Relay Node API using Federation because the Gateway needs to know Node's data type from ID to be able to pass request to the correct service.
During my research, I found the project apollo-federation-relay in which Victor Andrée extracted node data information by GlobalID decoding.
However, Ent uses Universal ID as GlobalID which is not according to follow GraphQL-Relay implementation. So the apollo-federation-relay project's way is not appropriate.
So I was thinking in two directions:
This discussion will talk about the 2nd way. Ent is needing to access information about the tables when running database migration to generate primary keys with the auto-increment counter
I suggest splitting this up into a simple interface that allows customization when running the migration. It will allow me to connect to a 3rd service to store tables and it's order. (extract all codes that access
universalID
andtypeRanges
from migrate.go)Next, in the implementation of the EntGQL extension, we will also access the external service to get its tables and ordering information.
The Relay Node API implementation can be deployed directly on the GraphQL Gateway using the same handling of the EntGQL extension.
Default implement in Ent/EntGQL still access the table
ent_types
. But it's allow to using remote service to get the information.Updates to class Migrate and Options
Beta Was this translation helpful? Give feedback.
All reactions