Just started to learn reason react and struggle with a graphql setup trying to read an ENUM value.
setup
- reason react
- apollo graphql
- graphql_ppx
- github graphql endpoint
i am fetching the latest pull request data over the github api and reading the status
property which is an enum and defined in the gql docs as:
- OPEN
- CLOSED
- MERGED
checking the network tab, i see the states are received as strings. within the application when I log the field i get a bunch of integers reflecting the values. can smb explain me, how i can "print" the data as string to my view and why they are translated to integers? is there somewhere a type generated which i could use for a variant switch?
let stateEnum = data->map(node => node##state);
Js.log(stateEnum) // possible values: 880069578, 982149804 or -1059826260
// somehow switch these values here?! :)
// current type of `stateEnum` is option('a)
thanks a lot in advance and have a nice day!