createType method
Creates a Type object.
May throw BadRequestException.
May throw ConcurrentModificationException.
May throw InternalFailureException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter apiId :
The API ID.
Parameter definition :
The type definition, in GraphQL Schema Definition Language (SDL) format.
For more information, see the GraphQL SDL documentation.
Parameter format :
The type format: SDL or JSON.
Implementation
Future<CreateTypeResponse> createType({
required String apiId,
required String definition,
required TypeDefinitionFormat format,
}) async {
final $payload = <String, dynamic>{
'definition': definition,
'format': format.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/apis/${Uri.encodeComponent(apiId)}/types',
exceptionFnMap: _exceptionFns,
);
return CreateTypeResponse.fromJson(response);
}