I’m using reason-apollo to fetch data from my GraphQL server. Sometimes I don’t want to fetch everything, so I only query a few fields, for instance:
projects {
id
name
}
The issue comes when I try to convert this query to a record. Say I’m using the following record:
[@bs.deriving jsConverter]
type project = {
id: int,
name: string,
color: option(string)
}
This gives an error, because the jsConverter expects: array({.. "color": option(string), "id": int, "name": string}). Is there a way to have jsConverter ignore fields that are wrapped in option?
Thanks,
Nicholas