introspectGraphql method

Future<GraphqlResponse> introspectGraphql(
  1. GraphqlRequest request,
  2. String name, {
  3. String? $fields,
})

Execute introspection query against the Firebase Data Connect's generated GraphQL schema.

GraphQL introspection query provides metadata such as what tables the schema have, what queries and mutations can be performed on the schema, and so on. Read more at https://graphql.org/learn/introspection. IntrospectGraphql can read schema metadata but cannot read rows from Cloud SQL instance, which can be done via ExecuteGraphqlRead.

request - The metadata request object.

Request parameters:

name - Required. The relative resource name of Firebase Data Connect service, in the format: projects/{project}/locations/{location}/services/{service} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GraphqlResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GraphqlResponse> introspectGraphql(
  GraphqlRequest request,
  core.String name, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':introspectGraphql';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return GraphqlResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}