Skip to content

Commit

Permalink
fix(entities): support for API filters for filtered data specs (#232)
Browse files Browse the repository at this point in the history
* fix(entities): support for API filters for filtered data specs

* nit: remove extra line
  • Loading branch information
skjindal93 authored Jun 11, 2024
1 parent a602821 commit a02e74f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions hypertrace-graphql-entity-schema/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
implementation(commonLibs.hypertrace.grpcutils.client)
implementation(projects.hypertraceGraphqlLabelsSchemaApi)

implementation(localLibs.core.request.transformation)
implementation(localLibs.core.context)
implementation(localLibs.core.grpc)
implementation(localLibs.core.schema.utils)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import lombok.extern.slf4j.Slf4j;
import org.hypertrace.core.graphql.common.request.AttributeRequest;
import org.hypertrace.core.graphql.context.GraphQlRequestContext;
import org.hypertrace.core.graphql.request.transformation.RequestTransformer;
import org.hypertrace.core.graphql.rx.BoundedIoScheduler;
import org.hypertrace.core.graphql.spi.config.GraphQlServiceConfig;
import org.hypertrace.core.graphql.utils.grpc.GrpcChannelRegistry;
Expand Down Expand Up @@ -44,6 +45,7 @@ class GatewayServiceEntityDao implements EntityDao {
private final GraphQlServiceConfig serviceConfig;
private final Scheduler boundedIoScheduler;
private final LabelJoinerBuilder labelJoinerBuilder;
private final RequestTransformer requestTransformer;

@Inject
GatewayServiceEntityDao(
Expand All @@ -55,13 +57,15 @@ class GatewayServiceEntityDao implements EntityDao {
GatewayServiceEntityConverter entityConverter,
BaselineDao baselineDao,
LabelJoinerBuilder labelJoinerBuilder,
RequestTransformer requestTransformer,
@BoundedIoScheduler Scheduler boundedIoScheduler) {
this.grpcContextBuilder = grpcContextBuilder;
this.requestBuilder = requestBuilder;
this.entityConverter = entityConverter;
this.baselineDao = baselineDao;
this.labelJoinerBuilder = labelJoinerBuilder;
this.serviceConfig = serviceConfig;
this.requestTransformer = requestTransformer;
this.boundedIoScheduler = boundedIoScheduler;

final GrpcChannelConfig grpcChannelConfig =
Expand All @@ -81,8 +85,9 @@ class GatewayServiceEntityDao implements EntityDao {
@Override
public Single<EntityResultSet> getEntities(EntityRequest request) {
GraphQlRequestContext context = request.resultSetRequest().context();
return this.requestBuilder
.buildRequest(request)
return this.requestTransformer
.transform(request)
.flatMap(this.requestBuilder::buildRequest)
.subscribeOn(this.boundedIoScheduler)
.flatMap(serverRequest -> this.fetchAndMapEntities(context, request, serverRequest));
}
Expand Down

0 comments on commit a02e74f

Please sign in to comment.