• This method will generate an array of mutation documents based on the changes between the original and the current values. It will detect the added and removed items and will call the generateCreateMutation or generateDeleteMutation for each of the differences. The methods are expected to return the GraphQL mutation call that needs to be executed to perform that adding or removing on the backend service.

    The method will return an array with all create and delete mutations that were created. The result can be used to wrap it into a GraphQL mutation like that:

    const mutation = `mutation MyArrayUpdate {
    ${generateArrayMutations({
    current: [1,2,3],
    original: [1,2],
    generateCreateMutation: createFn,
    generateDeleteMutation: deleteFn}).join('\n')}}
    }`

    Type Parameters

    • T

    Parameters

    Returns string[]

Generated using TypeDoc