zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.24k stars 612 forks source link

OperationException(linkException: ServerException #1297

Closed XOneto9 closed 1 year ago

XOneto9 commented 1 year ago

Hi, After upgrade flutter 3.7.3, I've got an error message of network.

QueryResult(source: QueryResultSource.network, data: null, context: Context({}), exception: OperationException(linkException: ServerException(originalException: Connection failed, originalStackTrace: #0      IOClient.send

before upgrade It was good work

The message is like below.

스크린샷 2023-02-13 오전 1 25 54

getMemberWithProvider(String provider, String providerId) async {
    try {
      final client = config.getClient();
      final options = QueryOptions(
        document: Queries.getMemberWithProvider,
        variables: {
          'provider': provider,
          'provider_id': providerId,
        },
        fetchPolicy: FetchPolicy.noCache,
      );
      final result = await client.query(options); // here, error is happened

    } catch (e) {
      print(e);
    }
  }

The debug message of result

QueryResult(source: QueryResultSource.network, data: null, context: Context({}), exception: OperationException(linkException: ServerException(originalException: Connection failed, originalStackTrace: #0      IOClient.send
io_client.dart:88
<asynchronous suspension>
#1      HttpLink._executeRequest
link.dart:131
<asynchronous suspension>
#2      HttpLink.request
link.dart:76
<asynchronous suspension>
, parsedResponse: null), graphqlErrors: []), timestamp: 2023-02-13 01:28:09.866691)

Also I was set real url address like as: 'http://192.168.x.x:3000/graphql' And, My custom server is running on docker nodejs and mongodb. server is very good condition. of cause, I can connect mongodb with Mongodb compass.

only, the problem to connect server is just flutter....

what can I do to solve it??

XOneto9 commented 1 year ago

Solved,

remove app on device, and re-computing computer.

and allow local network setting in my iPhone.