I use graphql-codegen + graphql-request to mutate some data like this:
export const updateRoomQuery = graphql(/* GraphQL */ `
mutation UpdateRoomInOffice($cmd: UpdateRoomInOfficeInput!) {
updateRoomInOffice(cmd: $cmd) {
roomId
roomType
}
}
`);
roomType
is this:
enum RoomType {
CHECKIN
CHECKOUT
DOCSOFFICE
EXAM
OTHER
}
input UpdateRoomInOfficeInput {
roomId: UUID!
roomType: RoomType!
}
In JS I call:
GQLClient.request(updateRoomQuery, { cmd: { roomType: "EXAM", roomId: '123' } });
And get this error:
The specified value type of field `roomType` does not match the field type.
I get that in the quotes are the problem, but how do I tell graphql-request that roomType should be treated as enum?