graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

customize generated field name for array relationships?

Open michael-land opened this issue 6 years ago • 6 comments

Thanks for all your work on beta 8, rename column is incredibly useful!

However, I am still facing some edge cases. For example, I have two schema: listing and listing snapshot, listing have many snapshots , hence I add an array relation on listing. Is there anyway to customize generated array relationship column name?

image

image

michael-land avatar Oct 23 '19 04:10 michael-land

Hi @xiaoyu-tamu, We're planning to support customising generated aggregate field for array relationships soon. :slightly_smiling_face:

rakeshkky avatar Nov 04 '19 06:11 rakeshkky

I would really like to see this feature implemented. Through custom root fields and columns I have been able to make my gql queries and resulting objects be perfectly aligned with JavaScript/TypeScript object notation standards.

I think this would really improve the feeling of consistency across all queries, as it is (for what I've seen so far), the only name we can't freely update.

We can, for the time being, rename the aggregate field directly in the query, but I think this would be a great feature to add.

Thanks.

emilioschepis avatar Apr 29 '20 07:04 emilioschepis

I would also very much welcome this feature! This would finally allow fully customizable and consistent naming.

Is there anything currently planned here?

stonymahony avatar Sep 29 '21 19:09 stonymahony

Would also love this feature 👍

sophiaritchie avatar Oct 09 '21 02:10 sophiaritchie

Is this relevant ? https://hasura.io/docs/latest/api-reference/syntax-defs/#custom-root-fields The aggregate object can be renamed using the select_aggregate key.

elias-pap avatar Sep 21 '22 12:09 elias-pap

Is this relevant ? https://hasura.io/docs/latest/api-reference/syntax-defs/#custom-root-fields The aggregate object can be renamed using the select_aggregate key.

No. The select_agg is only for root fields.

michael-land avatar Sep 21 '22 14:09 michael-land

Damn, was hoping this was possible. Added my +1 above 😄

rawkode avatar Jan 18 '23 22:01 rawkode