2 ms·
I had my own share of problems with generated code, so I feel you. I often use that utility when I have some type where under certain condition a value will al
by renke1 5y ago
I had my own share of problems with generated code, so I feel you.
I often use that utility when I have some type where under certain condition a value will always be defined, but a union type would make it too complex to be useful.
- dmitryminkovsky 5y agoYeah in my case I am using Postgres via Hasura, which exposes the Postgres DB via a GraphQL API, which in turn can be used to generate types. Unfortunately the nullability of fields in a Postgres view cannot be determined, so all fields in the corresponding types are nullable [0], even if they aren’t in the actual underlying table. So I end up using ! a lot because I know the field is non null in Postgres. It’s a unfortunate. [0] https://github.com/hasura/graphql-engine/issues/1965 https://github.com/hasura/graphql-engine/issues/1965