startSchemaCreation method

Future<StartSchemaCreationResponse> startSchemaCreation({
  1. required String apiId,
  2. required Uint8List definition,
})

Adds a new schema to your GraphQL API.

This operation is asynchronous. Use to determine when it has completed.

May throw BadRequestException. May throw ConcurrentModificationException. May throw NotFoundException. May throw UnauthorizedException. May throw InternalFailureException.

Parameter apiId : The API ID.

Parameter definition : The schema definition, in GraphQL schema language format.

Implementation

Future<StartSchemaCreationResponse> startSchemaCreation({
  required String apiId,
  required Uint8List definition,
}) async {
  ArgumentError.checkNotNull(apiId, 'apiId');
  ArgumentError.checkNotNull(definition, 'definition');
  final $payload = <String, dynamic>{
    'definition': base64Encode(definition),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/apis/${Uri.encodeComponent(apiId)}/schemacreation',
    exceptionFnMap: _exceptionFns,
  );
  return StartSchemaCreationResponse.fromJson(response);
}