In order to refresh the queries affected by the mutation, we need to use the refreshQueries parameter of the mutate function, as follows:
import {GET_USER_DATA} from './User';
// .....
mutation({
variables: {
login: login,
name: e.target.name.value
},
refetchQueries: [ { query: GET_USER_DATA, variables: {login: login} }],
});
Now, if we try and add a new repository, we will see it appear in the list of owned repositories for the user.
You should now be able to read data from Neo4j using GraphQL queries and insert data into the graph using mutations.