I build an api-platform app with a graphql endpoint. On client side I manage queries and mutations with apollo client like this(In vuejs front-end):
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
const httpLink = new HttpLink({
uri: 'http://localhost:8000/api/graphql'
})
export default new ApolloClient({
link: httpLink,
cache: new InMemoryCache(),
connectToDevTools: true
})
On my vuex store I use it like this:
fetchItems({commit}, options) {
commit(mutationsTypes.FETCHING_ITEMS);
client.query({
query: organismoQueries.SEARCH_ITEMS_QUERY(options),
}).then((res) => {
commit(mutationsTypes.FETCHING_ITEMS_SUCCESS, res.data.organismos.edges)
}).catch(error => console.error(error));
}
the query is working ok, the problem is that I can't reload the table results. When I resend the same query with the same options the graphql endpoint is never requested. I need to change the sorting of the table, but once I reach all combinations I'm not able to reload the table again.
I tried to introduce a random parameter in the query but I get an error from the server(obviously).
Is there a way to resend the same query and do something like reload the table.
Thanks in advance!