Skip to content

Commit f9d1ff9

Browse files
committed
feat: update queries and services to include module pagination for improved data retrieval
1 parent 32ba840 commit f9d1ff9

7 files changed

Lines changed: 55 additions & 13 deletions

File tree

src/packages/ce/src/datatype/services/Datatype.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export class DatatypeService extends ReactiveArrayService<DataType, DataTypeDepe
3636
namespaceId: namespaceId,
3737
projectId: projectId,
3838

39+
firstModule: 50,
40+
afterModule: null,
41+
3942
firstDataType: 50,
4043
afterDataType: null,
4144

@@ -46,7 +49,7 @@ export class DatatypeService extends ReactiveArrayService<DataType, DataTypeDepe
4649
afterRule: null,
4750
}
4851
}).then(res => {
49-
const nodes = res.data?.namespace?.project?.primaryRuntime?.dataTypes?.nodes ?? []
52+
const nodes = res.data?.namespace?.project?.primaryRuntime?.modules?.nodes?.flatMap(module => module?.dataTypes?.nodes ?? []) ?? []
5053
nodes.forEach(dataType => {
5154
if (dataType && !this.hasById(dataType.id)) {
5255
this.set(this.i++, new View(dataType))

src/packages/ce/src/datatype/services/queries/DataTypes.query.graphql

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
query DataTypes (
44
$namespaceId: NamespaceID!
55
$projectId: NamespaceProjectID!
6+
$firstModule: Int!
7+
$afterModule: String
68
$firstDataType: Int!
79
$afterDataType: String
810
$firstRule: Int!
@@ -11,11 +13,21 @@ query DataTypes (
1113
namespace(id: $namespaceId) {
1214
project(id: $projectId) {
1315
primaryRuntime {
14-
dataTypes (first: $firstDataType, after: $afterDataType) {
16+
modules(first: $firstModule, after: $afterModule) {
1517
__typename
1618
count
1719
nodes {
18-
...DataType
20+
dataTypes (first: $firstDataType, after: $afterDataType) {
21+
__typename
22+
count
23+
nodes {
24+
...DataType
25+
}
26+
pageInfo {
27+
endCursor
28+
hasNextPage
29+
}
30+
}
1931
}
2032
pageInfo {
2133
endCursor

src/packages/ce/src/flowtype/services/FlowType.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ export class FlowTypeService extends ReactiveArrayService<FlowType, FlowTypeDepe
3939
namespaceId: namespaceId,
4040
projectId: projectId,
4141

42+
firstModule: 50,
43+
afterModule: null,
44+
4245
firstFlowType: 50,
4346
afterFlowType: null,
4447
}
4548
}).then(res => {
46-
const nodes = res.data?.namespace?.project?.primaryRuntime?.flowTypes?.nodes ?? []
49+
const nodes = res.data?.namespace?.project?.primaryRuntime?.modules?.nodes?.flatMap(module => module?.flowTypes?.nodes ?? []) ?? []
4750
nodes.forEach(flowType => {
4851
if (flowType && !this.hasById(flowType.id)) {
4952
this.set(this.i++, new View(flowType))

src/packages/ce/src/flowtype/services/queries/FlowTypes.query.graphql

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@
33
query FlowTypes (
44
$namespaceId: NamespaceID!
55
$projectId: NamespaceProjectID!
6+
$firstModule: Int!
7+
$afterModule: String
68
$firstFlowType: Int!
79
$afterFlowType: String
810
) {
911
namespace(id: $namespaceId) {
1012
project(id: $projectId) {
1113
primaryRuntime {
12-
flowTypes (first: $firstFlowType, after: $afterFlowType) {
14+
modules(first: $firstModule, after: $afterModule) {
15+
__typename
1316
count
1417
nodes {
15-
...FlowType
18+
flowTypes (first: $firstFlowType, after: $afterFlowType) {
19+
count
20+
nodes {
21+
...FlowType
22+
}
23+
pageInfo {
24+
endCursor
25+
hasNextPage
26+
}
27+
}
1628
}
1729
pageInfo {
1830
endCursor

src/packages/ce/src/function/services/Function.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ export class FunctionService extends ReactiveArrayService<FunctionDefinition, Fu
3939
namespaceId: namespaceId,
4040
projectId: projectId,
4141

42+
firstModule: 50,
43+
afterModule: null,
44+
4245
firstFunction: 50,
4346
afterFunction: null,
4447

4548
firstParameterDefinition: 50,
4649
afterParameterDefinition: null,
4750
}
4851
}).then(res => {
49-
const nodes = res.data?.namespace?.project?.primaryRuntime?.functionDefinitions?.nodes ?? []
52+
const nodes = res.data?.namespace?.project?.primaryRuntime?.modules?.nodes?.flatMap(module => module?.functionDefinitions?.nodes ?? []) ?? []
5053
nodes.forEach(functionD => {
5154
if (functionD && !this.hasById(functionD.id)) {
5255
this.set(this.i++, new View(functionD))

src/packages/ce/src/function/services/queries/Functions.query.graphql

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
query Functions (
44
$namespaceId: NamespaceID!
55
$projectId: NamespaceProjectID!
6+
$firstModule: Int!
7+
$afterModule: String
68
$firstFunction: Int!
79
$afterFunction: String
810
$firstParameterDefinition: Int!
@@ -11,10 +13,20 @@ query Functions (
1113
namespace(id: $namespaceId) {
1214
project(id: $projectId) {
1315
primaryRuntime {
14-
functionDefinitions (first: $firstFunction, after: $afterFunction) {
16+
modules(first: $firstModule, after: $afterModule) {
17+
__typename
1518
count
1619
nodes {
17-
...Function
20+
functionDefinitions (first: $firstFunction, after: $afterFunction) {
21+
count
22+
nodes {
23+
...Function
24+
}
25+
pageInfo {
26+
endCursor
27+
hasNextPage
28+
}
29+
}
1830
}
1931
pageInfo {
2032
endCursor

src/packages/ce/src/runtime/services/fragments/Runtime.fragment.graphql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ fragment Runtime on Runtime {
1212
createdAt
1313
updatedAt
1414
token
15-
dataTypes {
16-
count
17-
}
18-
flowTypes {
15+
modules {
1916
count
2017
}
2118
projects {

0 commit comments

Comments
 (0)