contrib
contrib copied to clipboard
feat(entgql): support custom NodeID field
Thanks for the contribution @giautm. Would you mind elaborate on the use case? 🙂
Thanks for the contribution @giautm. Would you mind elaborate on the use case? 🙂
the use case it supports is when I migrate the old Ent-based project to support GQL NodeID (really exposed a Restful API). So, I need to keep the current ID column and add a new global_id to the schema. Then, expose it via this config. In the example, I really demo the use case:
type Document implements Node {
id: ID! @goField(name: "GlobalID")
legacyID: ID! @goField(name: "ID")
name: String!
}
PS: Github uses the same concept to support Restful API/GQL. I hope no one will run into this situation again, 🤦🙃
Hey @a8m, I renamed NodeIDField to NodeID and rebase the PR to the master branch. Will you consider merging it?