codegen-assets icon indicating copy to clipboard operation
codegen-assets copied to clipboard

if an action returns a list of objects, codegen still returns an object

Open wawhal opened this issue 4 years ago • 5 comments

These are the bunch of cases where codegen does incorrect things:

  1. If the derived action returns an object but the parent operation returns a list, it causes runtime error.
  2. If an action returns a list, codegen still returns just an object

wawhal avatar Apr 15 '20 09:04 wawhal

I had this issue too with the golang codegen.

For golang in particular, the custom types generated also are missing the required struct-tags to ensure the json generated has correct case when returned to hasura. Since the golang struct fields have to be capitalized for the marshaling to work, this is something that will often be an issue.

andoks avatar Jul 29 '20 17:07 andoks

@wawhal any updates on .2?

pimsomeday avatar Mar 11 '21 14:03 pimsomeday

Hello, we are still facing this issue with custom actions. It seems that generated schema is giving incorrect result type even though action is correctly typed:

console: image

introspected schema: image

on version v2.0.0-alpha.2.

Please advice

toniocodo avatar Apr 06 '21 10:04 toniocodo

having this exact same issue

briareus-the-titan avatar Feb 23 '22 02:02 briareus-the-titan

is there a work around yet?

briareus-the-titan avatar Feb 23 '22 02:02 briareus-the-titan