createNhostGraphQLClient function
GraphQLClient
createNhostGraphQLClient(})
Constructs a GQL client for accessing Nhost.io's backend.
The connection will be configured to automatically reflect the logged in
state of nhostClient
, and will change over time.
gqlCache
(optional) the GraphQL cache to provide to the client. Defaults
to a basic GraphQLCache
instance.
defaultHeaders
(optional) a map of headers that will accompany HTTP
requests and the initial web socket payload. Any matching headers set by the
client will overwrite the default values.
httpClientOverride
(optional) can be provided in order to customize the
requests made by the Nhost APIs, which can be useful for proxy configuration
and debugging.
Implementation
GraphQLClient createNhostGraphQLClient(
NhostClientBase nhostClient, {
GraphQLCache? gqlCache,
Map<String, String>? defaultHeaders,
http.Client? httpClientOverride,
}) {
return createNhostGraphQLClientForAuth(
nhostClient.gqlEndpointUrl,
nhostClient.auth,
gqlCache: gqlCache,
defaultHeaders: defaultHeaders,
httpClientOverride: httpClientOverride,
);
}