diff --git a/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.test.ts b/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.test.ts index f4a2bd7ae..c3773912d 100644 --- a/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.test.ts +++ b/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.test.ts @@ -68,9 +68,9 @@ describe('Graphql Argument Builder', () => { ); }); - test('construct arguments for entity type correctly', () => { - expect(argBuilder.forTraceType('entity-type')).toEqual( - expect.objectContaining({ name: 'type', value: new GraphQlEnumArgument('entity-type') }) + test('construct arguments for entity scope correctly', () => { + expect(argBuilder.forScope('entity-type')).toEqual( + expect.objectContaining({ name: 'scope', value: 'entity-type' }) ); }); diff --git a/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.ts b/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.ts index 9bbd6d573..a55a06143 100644 --- a/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.ts +++ b/projects/distributed-tracing/src/shared/graphql/request/builders/argument/graphql-argument-builder.ts @@ -1,5 +1,4 @@ import { GraphQlArgument, GraphQlEnumArgument } from '@hypertrace/graphql-client'; -import { EntityType } from '@hypertrace/observability'; import { GraphQlFilter } from '../../../model/schema/filter/graphql-filter'; import { GraphQlSortBySpecification } from '../../../model/schema/sort/graphql-sort-by-specification'; import { GraphQlTimeRange } from '../../../model/schema/timerange/graphql-time-range'; @@ -75,7 +74,7 @@ export class GraphQlArgumentBuilder { }; } - public forEntityType(type: EntityType): GraphQlArgument { - return { name: 'type', value: new GraphQlEnumArgument(type) }; + public forScope(scope: string): GraphQlArgument { + return { name: 'scope', value: scope }; } } diff --git a/projects/observability/src/shared/graphql/request/builders/argument/graphql-observability-argument-builder.ts b/projects/observability/src/shared/graphql/request/builders/argument/graphql-observability-argument-builder.ts index 825887e1b..ac69fc664 100644 --- a/projects/observability/src/shared/graphql/request/builders/argument/graphql-observability-argument-builder.ts +++ b/projects/observability/src/shared/graphql/request/builders/argument/graphql-observability-argument-builder.ts @@ -13,13 +13,6 @@ import { GraphQlIntervalUnit } from '../../../model/schema/interval/graphql-inte import { convertToGraphQlIntervalUnit } from '../specification/metric/metric-interval-unit-converter'; export class GraphQlObservabilityArgumentBuilder extends GraphQlArgumentBuilder { - public forEntityType(type: EntityType): GraphQlArgument { - return { - name: 'type', - value: new GraphQlEnumArgument(type) - }; - } - public forIncludeInactive(includeInactive?: boolean): GraphQlArgument[] { return includeInactive !== undefined ? [{ name: 'includeInactive', value: includeInactive }] : []; } diff --git a/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-builder.service.ts b/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-builder.service.ts index 4b5b93f83..92c53182a 100644 --- a/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-builder.service.ts +++ b/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-builder.service.ts @@ -34,7 +34,7 @@ export class EntitiesGraphqlQueryBuilderService { public buildRequestArguments(request: GraphQlEntitiesRequest): GraphQlArgument[] { return [ - this.argBuilder.forEntityType(request.entityType), + this.argBuilder.forScope(request.entityType), this.argBuilder.forLimit(request.limit), this.argBuilder.forTimeRange(request.timeRange), ...this.argBuilder.forOffset(request.offset), diff --git a/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-handler.service.test.ts b/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-handler.service.test.ts index 49d1d2d39..8442eefd9 100644 --- a/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-handler.service.test.ts +++ b/projects/observability/src/shared/graphql/request/handlers/entities/query/entities-graphql-query-handler.service.test.ts @@ -77,7 +77,7 @@ describe('Entities graphql query handler', () => { ): GraphQlSelection => ({ path: 'entities', arguments: [ - { name: 'type', value: new GraphQlEnumArgument(entityType) }, + { name: 'scope', value: entityType }, { name: 'limit', value: limit }, { name: 'between', @@ -201,7 +201,7 @@ describe('Entities graphql query handler', () => { expect(spectator.service.convertRequest(requestWithAvgrates)).toEqual({ path: 'entities', arguments: [ - { name: 'type', value: new GraphQlEnumArgument(ObservabilityEntityType.Service) }, + { name: 'scope', value: ObservabilityEntityType.Service }, { name: 'limit', value: 30 }, { name: 'between', @@ -327,7 +327,7 @@ describe('Entities graphql query handler', () => { expect(spectator.service.convertRequest(requestWithAvgrates)).toEqual({ path: 'entities', arguments: [ - { name: 'type', value: new GraphQlEnumArgument(ObservabilityEntityType.Service) }, + { name: 'scope', value: ObservabilityEntityType.Service }, { name: 'limit', value: 30 }, { name: 'between', diff --git a/projects/observability/src/shared/graphql/request/handlers/entities/query/interactions/interactions-graphql-query-handler.service.test.ts b/projects/observability/src/shared/graphql/request/handlers/entities/query/interactions/interactions-graphql-query-handler.service.test.ts index 10d8c788a..50e944d52 100644 --- a/projects/observability/src/shared/graphql/request/handlers/entities/query/interactions/interactions-graphql-query-handler.service.test.ts +++ b/projects/observability/src/shared/graphql/request/handlers/entities/query/interactions/interactions-graphql-query-handler.service.test.ts @@ -73,7 +73,7 @@ describe('Interactions graphql query handler', () => { expect(spectator.service.convertRequest(buildRequest())).toEqual({ path: 'entities', arguments: [ - { name: 'type', value: new GraphQlEnumArgument(ObservabilityEntityType.Backend) }, + { name: 'scope', value: ObservabilityEntityType.Backend }, { name: 'limit', value: 1 }, { name: 'between', diff --git a/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.test.ts b/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.test.ts index c3d04f7c8..6af18a252 100644 --- a/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.test.ts +++ b/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.test.ts @@ -242,7 +242,7 @@ describe('Entity topology graphql query handler', () => { expect(spectator.service.convertRequest(request)).toEqual({ path: 'entities', arguments: [ - { name: 'type', value: new GraphQlEnumArgument(ObservabilityEntityType.Service) }, + { name: 'scope', value: ObservabilityEntityType.Service }, { name: 'limit', value: 100 }, { name: 'between', diff --git a/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.ts b/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.ts index 4290b86e7..18c721bf0 100644 --- a/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.ts +++ b/projects/observability/src/shared/graphql/request/handlers/entities/query/topology/entity-topology-graphql-query-handler.service.ts @@ -37,7 +37,7 @@ export class EntityTopologyGraphQlQueryHandlerService return { path: 'entities', arguments: [ - this.argBuilder.forEntityType(request.rootNodeType), + this.argBuilder.forScope(request.rootNodeType), this.argBuilder.forLimit(request.rootNodeLimit), this.argBuilder.forTimeRange(request.timeRange), ...this.argBuilder.forFilters(