Open Adarsh2692 opened 2 years ago
I need to look inside it, now I did not remember
Wondering the same thing, following...
While implementing this, I constantly keep on getting the following error : The argument type 'HttpClient' can't be assigned to the parameter type 'Client?'
convert HttpClient
to IOClient
will solve this problem.
import "package:http/io_client.dart";
HttpClient httpClient = HttpClient();
httpClient.findProxy = (uri) {
return "PROXY $proxy;";
};
// Pass your newly instantiated HttpClient to http.IOClient.
return IOClient(httpClient);
referenced from here
In the issue https://github.com/zino-hofmann/graphql-flutter/issues/951 , it is mentioned to use following code to setup proxy in GraphQL :
HttpClient httpClient = HttpClient(); httpClient.findProxy = (uri) { return "PROXY localhost:3128;"; }; var link = HttpLink(baseUrl, httpClient: httpClient); var client = GraphQLClient( cache: GraphQLCache(), link: link, );
While implementing this, I constantly keep on getting the following error : The argument type 'HttpClient' can't be assigned to the parameter type 'Client?'
Please look into this and help me with a solution that works
@vincenzopalazzo , do we have a resolution to this? In the following comment you have mentioned that you will be working on a similar issue https://github.com/zino-hofmann/graphql-flutter/discussions/1018#discussioncomment-3762682