gqlAuthQuery method
Future gqlAuthQuery (String query, {Map<String, dynamic>? variables})
<p>This function is used to run the graph-ql query for authentication.</p> <p><strong>params</strong>:</p> <ul> <li><code>query</code>: query is used to fetch data in graphql, for more info read graphql docs</li> <li><code>variables</code>: variables to be passed with query</li> </ul> <p><strong>returns</strong>:</p> <ul> <li><code>Future<dynamic></code>: it returns Future of dynamic</li> </ul>
Implementation
Future\<dynamic\> gqlAuthQuery(
String query, \{
Map\<String, dynamic\>? variables,
\}) async \{
final QueryOptions options = QueryOptions(
document: gql(query),
variables: variables ?? \<String, dynamic\>\{\},
);
final QueryResult result = await clientAuth.query(options);
if there is an error or exception in [result]
if (result.hasException) \{
final exception = encounteredExceptionOrError(result.exception!);
if (exception!) \{
gqlAuthQuery(query, variables: variables);
\}
\} else if (result.data != null && result.isConcrete) \{
return result;
\}
return null;
\}