graphql-flutter icon indicating copy to clipboard operation
graphql-flutter copied to clipboard

Ability to cancel a query

Open sjmcdowall opened this issue 5 years ago • 20 comments

Is your feature request related to a problem? Please describe.

We are using the latest Beta ...

We have a "costly" query that, alas, the user is calling over and over before the first one is even completed causing resources etc. to be used (and a huge slowdown on the system). If the user submits a 2nd (or 3rd) query we'd like to cancel the prior one and submit the new one ..

Describe the solution you'd like

I believe Apollo has a .cancel() method on the Query object. That seems like a good solution :)

Describe alternatives you've considered We already have a keyboard debounce in place (300ms) but that isn't helping enough, the user is still able to submit a ton of queries and tie up the system.

Additional context Can't think of anything.

sjmcdowall avatar Mar 07 '19 10:03 sjmcdowall

You might be able to use the socket client, as it implements cancel.

As for GQL_STOP in the http client, support could take a while.

But if you can get it working with the socket subscription, an example would help our docs a lot 😄

micimize avatar Mar 31 '19 02:03 micimize

Hello there, is this already implemented?

normancarcamo avatar Jan 25 '21 16:01 normancarcamo

@normancarcamo no, if it was implemented this issue would be closed.

micimize avatar Jan 25 '21 17:01 micimize

We are looking something like dio's cancel token, right?

SalahAdDin avatar Jun 03 '21 12:06 SalahAdDin

same issue any update for this stuff? How is possible to cancel the previous request before I create a new one to reduce the workload to the backend side?

lekhactho111 avatar Jun 28 '21 10:06 lekhactho111

@micimize any updates ?

yeras-is avatar Apr 14 '22 11:04 yeras-is

any updates ?

No, this is hide for all the issue of the repository, so we don't start to work on it. at list we can start to look into it now

vincenzopalazzo avatar Apr 15 '22 06:04 vincenzopalazzo

any updates ?

No, this is hide for all the issue of the repository, so we don't start to work on it. at list we can start to look into it now

@vincenzopalazzo We are also very interested in this feature. Currently, implementing product search with GraphQL we have to ignore responses from all previous pending requests. It doesn't seem good due to performance reasons.

ezze avatar Apr 15 '22 13:04 ezze

@vincenzopalazzo We also need this feature for our app. Please consider this in future releases.

krishna-pietech avatar May 12 '22 13:05 krishna-pietech

Hey any updates on that one here?

appinteractive avatar Oct 07 '22 19:10 appinteractive

We didi not discuss about it yet, but PR are always welcome

vincenzopalazzo avatar Oct 07 '22 19:10 vincenzopalazzo

Any update guys?

EhabSalah avatar Nov 28 '22 22:11 EhabSalah