I have a js object based on form data that looks like this:
{
title: "SomeTitle",
scope: [{}],
// + ...other properties
}
One property (scope) is currently not supported and should not be part of the server payload. My mutation therefore looks like this:
export const addItemMutation = gql`
mutation AddItem($input: Item!) {
addItem(input: $input) @rest(type: "Post", path: "TmpApi", method: "POST") {
title
}
}
`;
Although the scope property is omitted from the mutation, all properties end up in the payload to the server, causing the request to fail:
How do I correctly omit fields from being sent as part of the mutation?