-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the Query call to server multiple times #575
Comments
I'm having the same issue. I have a query calling 3 times in a row and causing a problem. I could be doing something wrong but I can't figure it out. At first I thought it might be related to this: #121 but I don't think it is because I can see that it's hitting the network 3 times with the same exact request based on the logging in my server. This is an issue because when I first load a page I make a mutation to update a couple things but I don't want to show the updates until the next time the page is visited. However because it calls the endpoint multiple times this does not work. |
Are you guys using Navigator? |
@chungwong Yes, I use Navigator with MaterialPageRoute. I ignored the prev screen's behavior. |
I believe it is more than just related to MaterialPageRoute There is already a PR addressing this issue. |
I am facing the same problem, the build being done two times it´s expected. But the query being done to server multiple times is a problem and i cant figure out why. |
@pepomps Do you use MaterialPageRoute ? |
@chicrok I just implemented your solution, the problem was in MaterialPageRout, now it's working! thanks for the help!! |
I have the same problem and I don't know how to solve it. |
Sorry, could you show an example of how to make a query and not to do it three times? It doesn't work for me using the latest beta version of the package. Could you upload an example of how to make a query using the wiget Query and not make three requests to the server? |
@joseignaciopergolesi Did you play this ? (#575 (comment)) |
We found another bug that causes queries to be run multiple times in certain cases despite the fix in #533. That happens when:
|
I still face the problem . I am using graphql_flutter: ^4.0.1. I can see the solution is marked to make maintainState of MaterialPageRoute false. But where do I do that? My code looks like below: Please help. Its calling three times to server. ` @OverRide
} class HomeAuth extends StatelessWidget { class HomeAuthTabScreen extends StatefulWidget { @OverRide class _HomeAuthTabScreenState extends State { } final String _query = """ """; @OverRide
print("After Query is fired");
} |
Hi @dasarijit88 before being driven with time in your issue you need to do the following things:
Thanks |
I have upgraded to version |
Stil happening in |
Describe the bug
The Query Widget call to server multiple times.
When I used the FetchPolicy.cacheAndNetwork, I understand the twice builder call.
But, in my case, the builder method is calling three times and sometimes calls more.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Call one time to server.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: