contrib icon indicating copy to clipboard operation
contrib copied to clipboard

entgql: added Description() for adding meta data to a field

Open Albert-Gao opened this issue 3 years ago • 3 comments

Albert-Gao avatar Aug 10 '22 19:08 Albert-Gao

@a8m thanks for the comments, how to do this please? I checked the file, but do not know how to link the added the field to this FieldConfig.Descrption. What I am missing here please? Thanks :)

Albert-Gao avatar Aug 15 '22 18:08 Albert-Gao

Hello @Albert-Gao, you need to add def.Description to this block of code. It's our query field on the Query Object. https://github.com/ent/contrib/blob/a1f3cb44bdfe32a9ea7d1cea048b12f681ce6570/entgql/schema.go#L208-L231

The latest thing, don't forget to merge annotation if we have more than one on the entity: https://github.com/ent/contrib/blob/a1f3cb44bdfe32a9ea7d1cea048b12f681ce6570/entgql/annotation.go#L463-L471

giautm avatar Aug 15 '22 19:08 giautm

Thanks, @giautm added, please check.

Albert-Gao avatar Aug 15 '22 20:08 Albert-Gao

image

Why this test is failing locally? 🤣 anyway, fixed the test of the updated schema

Albert-Gao avatar Aug 16 '22 20:08 Albert-Gao