This is my code so far:
<Mutation mutation={addUserQuery}>
{
(addUser, data)=>{
console.log(data)
return (
<div className="form">
<form onSubmit={(e)=>{
e.preventDefault();
console.log(e);
addUser({variables: {username: "AuraDivitiae",
firstname: "Michael",
lastname: "Lee"}})
}}>
<button type="submit">Add User</button>
</form>
</div>
)
}
}
</Mutation>
What does Apollo do when a mutation component mounts?
I feel like I don't really understand the processes running inside Apollo.
Does Apollo subscribe to the result of the mutation query?
Does it then update the cache on returning?
Is Data then stored in some components state?
I feel like the documentation doesn't provide enough information sometimes...