Exemple #1
0
        public async Task <SchemaPublishReport?> GetPublishReportByEnvironmentAsync(
            string environmentName,
            [Parent] SchemaVersion schemaVersion,
            [Service] ISchemaRepository schemaRepository,
            [Service] IEnvironmentRepository environmentRepository,
            CancellationToken cancellationToken)
        {
            Environment?environment = await environmentRepository.GetEnvironmentAsync(
                environmentName, cancellationToken)
                                      .ConfigureAwait(false);

            if (environment is null)
            {
                throw new GraphQLException(
                          $"The specified environment `{environmentName}` does not exist.");
            }

            return(await schemaRepository.GetPublishReportAsync(
                       schemaVersion.Id, environment.Id, cancellationToken)
                   .ConfigureAwait(false));
        }