Skip to main content
Version: 1.x

getMutationKey(...)

The method provides a standardized way to generate MutationKey for Mutations. It could be used to check mutation status, or to cancel a mutation.

qraft.<service>.<operation>.getMutationKey(parameters)

Argumentsโ€‹

    • parameters: { path, query, header } | undefined
      • Optional, OpenAPI request parameters for the mutation, strictly-typed โœจ
      • parameters will be used to generate the MutationKey
      • If not specified, returns a MutationKey with {} as a Mutation parameters

Returnsโ€‹

MutationKey - a mutation key for the operation parameters

Exampleโ€‹

expect(
qraft.entities.postEntitiesIdDocuments.getMutationKey({
header: {
'x-monite-version': '1.0.0',
},
path: {
entity_id: '1',
},
query: {
referer: 'https://example.com',
},
})
).toEqual([
{
url: qraft.entities.postEntitiesIdDocuments.schema.url,
method: qraft.entities.postEntitiesIdDocuments.schema.method,
},
{
header: {
'x-monite-version': '1.0.0',
},
path: {
entity_id: '1',
},
query: {
referer: 'https://example.com',
},
},
]);