getFromInstance static method

Future<GraphQLClient> getFromInstance(
  1. dynamic instance
)

Get the GraphQL client from parent instance

Implementation

static Future<GraphQLClient> getFromInstance(dynamic instance) async {
  GraphQLClient? client = await PipenGraphqlClient.withoutAuth?.call();

  if (instance is PipenGraphqlAuthentication) {
    client = await PipenGraphqlClient.withAuth?.call();
  }

  if (client == null) {
    throw GraphqlClientNotFound();
  }

  return client;
}