clientToQuery method
GraphQLClient
clientToQuery(
{ - required String url,
})
Implementation
GraphQLClient clientToQuery({required String url}) {
HttpLink httpLink = HttpLink(
"${ApiConstant.graphQlBaseUrl}${ApiConstant.graphQlServiceUrl}$url",
defaultHeaders: {
"X-User-Id": SingletonSotrage.secureStorageInterface
.readSecureData(SecureStorageService.xUserId) ??
"",
"X-User-Name": SingletonSotrage.secureStorageInterface.readSecureData(
SecureStorageService.preferedUserName,
) ??
"",
"X-Request-Id": "tedhsjdh",
"X-API-Key": jwt,
"Authorization": "Bearer $jwt",
"X-Channel": UserChecker.isStoreUser()
? Constants.xPosChannel
: Constants.xDealerChannel,
});
debugPrint(
'${ApiConstant.graphQlBaseUrl}${ApiConstant.graphQlServiceUrl}$url');
return GraphQLClient(
link: httpLink,
cache: GraphQLCache(),
queryRequestTimeout: const Duration(seconds: 60),
);
}