Skip to main content
Version: 2.x ๐Ÿšง

getMutationKey(...)

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

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

Argumentsโ€‹

    • parameters: { path, query, header } | void
      • Optional, OpenAPI request parameters for the mutation, strictly-typed โœจ
      • parameters will be used to generate the MutationKey

Returnsโ€‹

MutationKey - a mutation key for the operation parameters

Exampleโ€‹

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