From a8728b8478c5b9837f9e83b2fb4b0ca27b0940b0 Mon Sep 17 00:00:00 2001 From: Jake Bassett Date: Thu, 31 Mar 2022 13:13:55 -0700 Subject: [PATCH] feat: add operator argument to GraphQlIdFilter --- .../model/schema/filter/id/graphql-id-filter.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/projects/observability/src/shared/graphql/model/schema/filter/id/graphql-id-filter.ts b/projects/observability/src/shared/graphql/model/schema/filter/id/graphql-id-filter.ts index 9fd11df3d..c2a867802 100644 --- a/projects/observability/src/shared/graphql/model/schema/filter/id/graphql-id-filter.ts +++ b/projects/observability/src/shared/graphql/model/schema/filter/id/graphql-id-filter.ts @@ -4,12 +4,16 @@ import { GraphQlFilter, GraphQlFilterType, GraphQlOperatorType } from '../graphq export class GraphQlIdFilter implements GraphQlFilter { public readonly key: string = 'id'; - public constructor(public readonly id: string, public readonly idScope: string) {} + public constructor( + public readonly id: string, + public readonly idScope: string, + public readonly operator: GraphQlOperatorType = GraphQlOperatorType.Equals + ) {} public asArgumentObjects(): [GraphQlIdFilterArgument] { return [ { - operator: new GraphQlEnumArgument(GraphQlOperatorType.Equals), + operator: new GraphQlEnumArgument(this.operator), value: this.id, type: new GraphQlEnumArgument(GraphQlFilterType.Id), idType: new GraphQlEnumArgument(this.idScope) @@ -21,7 +25,7 @@ export class GraphQlIdFilter implements GraphQlFilter { // tslint:disable-next-line: interface-over-type-literal https://github.com/Microsoft/TypeScript/issues/15300 type GraphQlIdFilterArgument = { value: GraphQlArgumentValue; - operator: GraphQlEnumArgument; + operator: GraphQlEnumArgument; type: GraphQlEnumArgument; idType: GraphQlEnumArgument; };