Open totzk9 opened 3 weeks ago
Currently working on a PR for this.
Awesome, thanks for the report and for the PR :)
For anyone who uses the latest and wants to override the timeout when doing:
dependencies
or dependency_overrides
in their project
dependency:
graphql: ^5.2.0-beta.9
You can just create your own createNhostGraphQLClientForAuth
function:
import 'package:graphql/client.dart';
import 'package:http/http.dart' as http;
import 'package:nhost_gql_links/nhost_gql_links.dart';
import 'package:nhost_sdk/nhost_sdk.dart';
GraphQLClient createNhostGraphQLClient(
NhostClientBase nhostClient, {
Map<String, String>? defaultHeaders,
http.Client? httpClientOverride,
GraphQLCache? gqlCache,
DefaultPolicies? defaultPolicies,
bool? alwaysRebroadcast,
DeepEqualsFn? deepEquals,
bool? deduplicatePollers,
Duration? queryRequestTimeout,
}) {
return GraphQLClient(
link: combinedLinkForNhostAuth(
nhostClient.gqlEndpointUrl,
nhostClient.auth,
defaultHeaders: defaultHeaders,
httpClientOverride: httpClientOverride,
),
cache: gqlCache ?? GraphQLCache(),
defaultPolicies: defaultPolicies,
alwaysRebroadcast: alwaysRebroadcast ?? false,
deepEquals: deepEquals,
deduplicatePollers: deduplicatePollers ?? false,
queryRequestTimeout: queryRequestTimeout ?? const Duration(seconds: 60),
);
}
The graphql-v5.2.0-beta.9 dependency package being used in
nhost-dart
SDK added a 5 second timeout which causes Nhost apps to fail abrupty.graphql-v5.2.0-beta.9 related commit: https://github.com/zino-hofmann/graphql-flutter/commit/6180841e9b703d9c312ea29e575dece973c691bc
We should add an optional parameter to be able to increase the Timeout in
createNhostGraphQLClientForAuth
.