Skip to content

Commit e1ce656

Browse files
authored
feat: add operator argument to GraphQlIdFilter (#1522)
1 parent c8bffe3 commit e1ce656

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

projects/observability/src/shared/graphql/model/schema/filter/id/graphql-id-filter.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import { GraphQlFilter, GraphQlFilterType, GraphQlOperatorType } from '../graphq
44
export class GraphQlIdFilter implements GraphQlFilter {
55
public readonly key: string = 'id';
66

7-
public constructor(public readonly id: string, public readonly idScope: string) {}
7+
public constructor(
8+
public readonly id: string,
9+
public readonly idScope: string,
10+
public readonly operator: GraphQlOperatorType = GraphQlOperatorType.Equals
11+
) {}
812

913
public asArgumentObjects(): [GraphQlIdFilterArgument] {
1014
return [
1115
{
12-
operator: new GraphQlEnumArgument(GraphQlOperatorType.Equals),
16+
operator: new GraphQlEnumArgument(this.operator),
1317
value: this.id,
1418
type: new GraphQlEnumArgument(GraphQlFilterType.Id),
1519
idType: new GraphQlEnumArgument(this.idScope)
@@ -21,7 +25,7 @@ export class GraphQlIdFilter implements GraphQlFilter {
2125
// tslint:disable-next-line: interface-over-type-literal https://github.com/Microsoft/TypeScript/issues/15300
2226
type GraphQlIdFilterArgument = {
2327
value: GraphQlArgumentValue;
24-
operator: GraphQlEnumArgument<GraphQlOperatorType.Equals>;
28+
operator: GraphQlEnumArgument<GraphQlOperatorType>;
2529
type: GraphQlEnumArgument<GraphQlFilterType.Id>;
2630
idType: GraphQlEnumArgument<string>;
2731
};

0 commit comments

Comments
 (0)