Skip to content

Commit

Permalink
AAE-22508 Add inline documentation for aggregated data in GraphQL que…
Browse files Browse the repository at this point in the history
…ry shema (#1453)

* update graphql-jpa-query.version to 1.2.7

* Update ActivitiGraphQLStarterIT tests
  • Loading branch information
igdianov authored May 29, 2024
1 parent 6bbd562 commit 021c195
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion activiti-cloud-notifications-graphql-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Activiti Cloud Notifications GraphQL Service :: Parent</name>
<packaging>pom</packaging>
<properties>
<graphql-jpa-query.version>1.2.6</graphql-jpa-query.version>
<graphql-jpa-query.version>1.2.7</graphql-jpa-query.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1435,14 +1435,16 @@ public void testGraphqlAggregateTaskVariablesQuery() {
name: by(field: name)
count
}
groupByTaskStatus: task {
status: by(field: status)
count
}
# Count by associated tasks
groupByTaskAssignee: task {
assignee: by(field: assignee)
count
by {
groupByTaskStatus: task {
status: by(field: status)
count
}
# Count by associated tasks
groupByTaskAssignee: task {
assignee: by(field: assignee)
count
}
}
}
}
Expand All @@ -1464,7 +1466,7 @@ public void testGraphqlAggregateTaskVariablesQuery() {
assertThat(result.getErrors()).isNull();

var expected =
"{TaskVariables={aggregate={variables=3, groupByVariableName=[{name=variable1, count=1}, {name=variable2, count=1}, {name=variable3, count=1}], groupByTaskStatus=[{status=COMPLETED, count=2}, {status=CREATED, count=1}], groupByTaskAssignee=[{assignee=assignee, count=3}]}}}";
"{TaskVariables={aggregate={variables=3, groupByVariableName=[{name=variable1, count=1}, {name=variable2, count=1}, {name=variable3, count=1}], by={groupByTaskStatus=[{status=COMPLETED, count=2}, {status=CREATED, count=1}], groupByTaskAssignee=[{assignee=assignee, count=3}]}}}}";

assertThat(result.getData().toString()).isEqualTo(expected);
}
Expand All @@ -1487,14 +1489,16 @@ public void testGraphqlAggregateTasksQuery() {
name: by(field: name)
count(of: processVariables)
}
countTaskProcessVariablesGroupedByVariableNameAndValue: processVariables {
name: by(field: name)
value: by(field: value)
count
}
countTaskVariablesGroupedByVariableName: variables {
name: by(field: name)
count
by {
countTaskProcessVariablesGroupedByVariableNameAndValue: processVariables {
name: by(field: name)
value: by(field: value)
count
}
countTaskVariablesGroupedByVariableName: variables {
name: by(field: name)
count
}
}
}
}
Expand All @@ -1516,7 +1520,7 @@ public void testGraphqlAggregateTasksQuery() {
assertThat(result.getErrors()).isNull();

var expected =
"{Tasks={aggregate={countTasks=6, countProcessVariables=2, countTaskVariables=6, countTasksGroupedByStatus=[{status=ASSIGNED, count=1}, {status=COMPLETED, count=2}, {status=CREATED, count=3}], countProcessVariablesGroupedByTaskName=[{name=task4, count=1}, {name=task5, count=1}], countTaskProcessVariablesGroupedByVariableNameAndValue=[{name=initiator, value={key=[1, 2, 3, 4, 5]}, count=2}], countTaskVariablesGroupedByVariableName=[{name=variable1, count=1}, {name=variable2, count=1}, {name=variable3, count=1}, {name=variable4, count=1}, {name=variable5, count=1}, {name=variable6, count=1}]}}}";
"{Tasks={aggregate={countTasks=6, countProcessVariables=2, countTaskVariables=6, countTasksGroupedByStatus=[{status=ASSIGNED, count=1}, {status=COMPLETED, count=2}, {status=CREATED, count=3}], countProcessVariablesGroupedByTaskName=[{name=task4, count=1}, {name=task5, count=1}], by={countTaskProcessVariablesGroupedByVariableNameAndValue=[{name=initiator, value={key=[1, 2, 3, 4, 5]}, count=2}], countTaskVariablesGroupedByVariableName=[{name=variable1, count=1}, {name=variable2, count=1}, {name=variable3, count=1}, {name=variable4, count=1}, {name=variable5, count=1}, {name=variable6, count=1}]}}}}";

assertThat(result.getData().toString()).isEqualTo(expected);
}
Expand Down

0 comments on commit 021c195

Please sign in to comment.