Problems when using generated input types from Hasura backend
See original GitHub issueI’m facing several issues trying to execute mutation on a F# backend towards Hasura, sending instances of the generated input types, such as
type Example_insert_input =
{ AnotherType: Option<AnotherType_obj_rel_insert_input>
anotherType: Option<string>
id: Option<string>
}
When using default serializer Newtonsoft.Json, it throws an exception A member with the name 'anotherType' already exists on 'KrevS2Graphql.SkillModelVersion_insert_input'. Use the JsonPropertyAttribute to specify another name.
When using System.Text.Json (“system”) serializer, Hasura return an error due to a mismatch between discriminated union names. Upon further investigation, this is caused by the fact that the CompiledName attributed is not respected.
Next step is to set “normalizeEnumCases” to false.
This solves the previous issues, but another error is given back by Hasura: expected an object for type 'Example_bool_exp', but found null. So, it looks like properties set to None on the various types generated by Snowflaqe are not serialized in a way that Hasura correctly receive them - I think those properties should be excluded, instead of defined with a null value.
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (6 by maintainers)

Top Related StackOverflow Question
It is now working, thank you very much!
@gmlion thanks for confirming 🙏 glad to hear it is working for you