Delete update mutation doesnt work

type Message @withSubscription {
  id: ID!
  name: String!
  text: String!
  time: DateTime!
}

  const handleDelete = ( ) => {

        updateMessage({'variables': { "patch":
                        { "filter": {
                            "text": ["sdf"]
                          },
                          "set": {
                            "text": "updated text"
                          }
                        }
                      } } );

    }

const DELETE_MESSAGE = gql`
  mutation updateMessage($patch: UpdateMessageInput!) {
    updateMessage(input: $patch) {
      message {
              name
              text
              time
            }
    }
  }
`;

response - Unhandled Rejection (Error): unknown field

or without ‘variables’
Unhandled Rejection (Error): must be defined

i think some error in Syntax but i cant find any examples on it mutations
can somebody help?

Do you have a function named updateMessage that receives the variables block and then executes the gql via a GraphQL client (like Apollo). Because in your example code, I see a call to updateMessage with a variables JSON object passed to it, but there is no function definition for it.

EDIT: Example from my codebase (uses SvelteQuery and Awesome GraphQL Client)

  import { graphQLClient } from '$lib/configs/awesome-graphql-client.ts';
  import { UpsertWordMutation } from '$lib/graphql/mutations/words.graphql';

  const upsertWordRequest = useMutation((variables) => {
    return graphQLClient.request(UpsertWordMutation, variables);
  });

  function mutateWord(updatedWord, onSuccessFn) {
    try {
      $upsertWordRequest.mutate({ input: updatedWord }, {
        onSuccess: onSuccessFn
      });
    } catch(error) {
      console.log(error);
    }
  }