getIntrospectionSchema method
Retrieves the introspection schema for a GraphQL API.
May throw GraphQLSchemaException.
May throw InternalFailureException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter apiId :
The API ID.
Parameter format :
The schema format: SDL or JSON.
Parameter includeDirectives :
A flag that specifies whether the schema introspection should contain
directives.
Implementation
Future<GetIntrospectionSchemaResponse> getIntrospectionSchema({
required String apiId,
required OutputType format,
bool? includeDirectives,
}) async {
final $query = <String, List<String>>{
'format': [format.value],
if (includeDirectives != null)
'includeDirectives': [includeDirectives.toString()],
};
final response = await _protocol.sendRaw(
payload: null,
method: 'GET',
requestUri: '/v1/apis/${Uri.encodeComponent(apiId)}/schema',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetIntrospectionSchemaResponse(
schema: await response.stream.toBytes(),
);
}