Skip to main content

Core Mutations

The mutations can be used as regular queries, following the same instructions as mentioned in Core Basic Usage, but instead of using the autogenerated query object, you should use the mutation object.

Example#

import { resolved, mutation } from '../gqless';
resolved(() => {
const { email, name } = mutation.createUser({
email: 'xx@xx.com',
name: 'XX',
});
return {
email,
name,
};
})
.then((data) => {
console.log('User created!', data);
})
.catch((err) => {
console.error(err);
});

See also#

Last updated on by Nate Wienert