Skip to content

Commit 0968a15

Browse files
kamilkisielan1ru4l
authored andcommitted
ye
1 parent 5b98861 commit 0968a15

File tree

7 files changed

+929
-651
lines changed

7 files changed

+929
-651
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"docker:override-up": "docker compose -f ./docker/docker-compose.override.yml up -d --remove-orphans",
2929
"env:sync": "tsx scripts/sync-env-files.ts",
3030
"generate": "pnpm --filter @hive/storage db:generate && pnpm graphql:generate",
31-
"graphql:generate": "graphql-codegen --config codegen.mts",
31+
"graphql:generate": "VERBOSE=1 graphql-codegen --config codegen.mts",
3232
"integration:prepare": "cd integration-tests && ./local.sh",
3333
"lint": "eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
3434
"lint:env-template": "tsx scripts/check-env-template.ts",

packages/services/api/src/modules/operations/module.graphql.mappers.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import type Dataloader from 'dataloader';
12
import type { ClientStatsValues, OperationStatsValues, PageInfo } from '../../__generated__/types';
23
import type { DateRange } from '../../shared/entities';
34

5+
// import { SqlValue } from './providers/sql';
6+
47
type Connection<TNode> = {
58
pageInfo: PageInfo;
69
edges: Array<{ node: TNode; cursor: string }>;
@@ -41,3 +44,17 @@ export interface DurationValuesMapper {
4144
p95: number | null;
4245
p99: number | null;
4346
}
47+
48+
export type TracesFilterOptionsMapper = {
49+
// ANDs: readonly SqlValue[];
50+
loader: Dataloader<
51+
{
52+
key: string;
53+
columnExpression: string;
54+
limit: number | null;
55+
arrayJoinColumn: string | null;
56+
},
57+
{ value: string; count: number }[],
58+
string
59+
>;
60+
};

packages/services/api/src/modules/operations/module.graphql.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,82 @@ export default gql`
259259
body: String! @tag(name: "public")
260260
}
261261
262+
type TraceConnection {
263+
edges: [TraceEdge!]!
264+
pageInfo: PageInfo!
265+
}
266+
267+
type TraceEdge {
268+
node: Trace!
269+
cursor: String!
270+
}
271+
272+
type Trace {
273+
id: ID!
274+
timestamp: DateTime!
275+
operationName: String!
276+
operationType: GraphQLOperationType!
277+
duration: Int!
278+
subgraphs: [String!]!
279+
success: Boolean!
280+
clientName: String
281+
clientVersion: String
282+
httpStatusCode: Int
283+
httpMethod: String
284+
httpHost: String
285+
httpRoute: String
286+
httpUrl: String
287+
}
288+
289+
input TracesFilterInput {
290+
id: [ID!]
291+
operationName: [String!]
292+
operationType: [GraphQLOperationType!]
293+
success: [Boolean!]
294+
httpStatusCode: [Int!]
295+
httpMethod: [String!]
296+
httpHost: [String!]
297+
httpRoute: [String!]
298+
httpUrl: [String!]
299+
subgraphs: [String!]
300+
}
301+
302+
type TracesFilterOptions {
303+
success: [FilterBooleanOption!]!
304+
operationType: [FilterStringOption!]!
305+
operationName(top: Int): [FilterStringOption!]!
306+
httpStatusCode(top: Int): [FilterIntOption!]!
307+
httpMethod(top: Int): [FilterStringOption!]!
308+
httpHost(top: Int): [FilterStringOption!]!
309+
httpRoute(top: Int): [FilterStringOption!]!
310+
httpUrl(top: Int): [FilterStringOption!]!
311+
subgraphs(top: Int): [FilterStringOption!]!
312+
}
313+
314+
type FilterStringOption {
315+
value: String!
316+
count: Int!
317+
}
318+
319+
type FilterBooleanOption {
320+
value: Boolean!
321+
count: Int!
322+
}
323+
324+
type FilterIntOption {
325+
value: Int!
326+
count: Int!
327+
}
328+
262329
extend type Target {
263330
requestsOverTime(resolution: Int!, period: DateRangeInput!): [RequestsOverTime!]!
264331
totalRequests(period: DateRangeInput!): SafeInt!
265332
"""
266333
Retrieve an operation via it's hash.
267334
"""
268335
operation(hash: ID! @tag(name: "public")): Operation @tag(name: "public")
336+
traces(first: Int, after: String, filter: TracesFilterInput): TraceConnection!
337+
tracesFilterOptions(filter: TracesFilterInput): TracesFilterOptions!
269338
}
270339
271340
extend type Project {

0 commit comments

Comments
 (0)