Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mutationObj = {};
mutationObj[`set_${entryId}`] = params(
Object.keys(data).reduce((result, key) => {
result[key] = `"${data[key]}"`;
return result;
},{}),
Object.keys(fields).reduce((result, key) => {
result[key] = types.string;
return result;
},{})
);
return {
mutation: gql`${mutation(mutationObj)}`,
context: context
}
};