-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
": Undefined location" when running a manual Mutation (next branch) + Random 127.0.0.1 connections #186
Comments
Same Error:
|
I mean, is this project still alive? At least, a quick reply would be appreciated. Thanks. |
Don't think it is....https://github.com/snowballdigital/flutter-graphql but still the same problem! |
This only occurs when there is an error returned in the mutation, at least with snowballdigital's fork. This catch statement breaks, as the error object is a builtin dart error that has no message getter. If there's no error, the mutation succeeds and the data is returned correctly. |
But that doesn't explain why no connection is made to my GraphQL server, at all.
Logically, the framework will never know if there was error unless it connects to the GraphQL first. The main problem here is that the Flutter app using the library never connects to the actual GraphQL server; instead, it tries to connect to random ports. The question of why it does that is still not answered. |
@eliezedeck I was able to connect to my server fine on both Android and iOS emulators - I'm hosting it remotely, as I was unable to get localhost binding working (in this instance, unless you have a port forwarding setup working, localhost is referring to the actual emulator). I'm fairly sure that the issue you reported happens whenever any error occurs, and we were experiencing separate issues. Can you connect to your endpoint using just the Dart HTTP client (you may need to try 10.0.2.2 if you're on Android)? If you're unable to, the connection issue is not related to this library. |
@yunyu to be clear, you were unable to connect to The "random ports" can happen as a result of network issues. I'm investigating similar connection issues with To keep track of this, here are the environs we're trying to resolve this for:
|
@micimize It's more of a laziness factor 😢 We didn't bother looking up the 10.0.2.2 and localhost difference for Android and iOS, and somehow ended up using the same one for testing. That said, I am running into this bug (or at least a variant of it) even when there are no networking issues - errors with a status code of 400 but returning a valid GraphQL response are "eaten" with 400 Bad Request (such as Apollo syntax/data format errors). |
Just kidding, I'm dumb. This is an issue with the current next branch of this library, but not with https://github.com/snowballdigital/flutter-graphql. I just did a quick conversion between the two, and flutter_graphql worked without a SocketError while rev |
Check operationName before constructing regex in Operation.isSubscription, fixes #186
🎉 This issue has been resolved in version 1.0.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Describe the bug
When running a mutation manually, I get 2 errors at different code levels:
SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 33860
with random port (location is:flutter_graphql/src/link/link_http.dart:85
) ... this is directly related to the mutation that I'm trying to run: Undefined location
after getting the awaited result of the mutation. Note that my backend is on localhost.I was trying to get to the code that caused connections to random ports, but I couldn't use the IDE to pin-point the source of the problem. Makes me wonder, why is it doing this random connection and not connecting to where it's supposed to.
To Reproduce
Steps to reproduce the behavior:
flutter_graphql
(same exact behavior when usinggraphql_flutter
'snext
branch or 1.0.0 beta)HttpLink
that is pointing to a fixedhttp://localhost:8080/v1/graphql
SocketException
Expected behavior
A connection is made to my GraphQL backend. Unfortunately, my backend stays still, not receiving any connection at all.
Screenshots
Here are some screens:
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I was looking at the 0.9.5 version, but there was no way to run manual Mutations.
The text was updated successfully, but these errors were encountered: