Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function executeMutation(client, link = client.link, offlineRecord) {
const { request: { payload }, id } = offlineRecord;
console.log("execute", id, client)
const operation = payload.operation;
return observableToPromise({ observable: multiplex(execute(link, operation)) }, result => result);
}
},
} = offlineRecord;
const query = client.queryManager.transform(mutation).document;
const operation = {
query,
variables,
operationName: getOperationName(query) || void 0,
context: client.queryManager.prepareContext({
...context,
forceFetch: true,
}),
};
const options: Options = {
observable: multiplex(execute(link, operation)) as any,
};
return observableToPromise(options, (result) => result);
}