From d2a568c6212e78976f9b72a5d4d75a6c920f18ae Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 12 Dec 2022 08:21:51 +0000 Subject: [PATCH 1/2] Fix PostGraphile queries --- artifacts/queryTemplates/main-PostGraphile/QT1.txt | 8 ++------ .../queryTemplates/main-PostGraphile/QT10.txt | 4 +--- .../queryTemplates/main-PostGraphile/QT11.txt | 4 +--- .../queryTemplates/main-PostGraphile/QT12.txt | 14 ++++---------- .../queryTemplates/main-PostGraphile/QT15.txt | 6 ++---- artifacts/queryTemplates/main-PostGraphile/QT2.txt | 14 ++++---------- artifacts/queryTemplates/main-PostGraphile/QT3.txt | 10 +++------- artifacts/queryTemplates/main-PostGraphile/QT4.txt | 10 +++------- artifacts/queryTemplates/main-PostGraphile/QT5.txt | 14 ++++---------- artifacts/queryTemplates/main-PostGraphile/QT6.txt | 10 +++------- artifacts/queryTemplates/main-PostGraphile/QT7.txt | 8 ++------ artifacts/queryTemplates/main-PostGraphile/QT8.txt | 6 ++---- artifacts/queryTemplates/main-PostGraphile/QT9.txt | 14 ++++---------- 13 files changed, 35 insertions(+), 87 deletions(-) diff --git a/artifacts/queryTemplates/main-PostGraphile/QT1.txt b/artifacts/queryTemplates/main-PostGraphile/QT1.txt index 9842805..d137064 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT1.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT1.txt @@ -1,15 +1,11 @@ -query faculty_university_graduateStudent($facultyID:ID) +query faculty_university_graduateStudent($facultyID:ID!) { - allFaculties(condition: { nr:$facultyID }){ - nodes { + facultyByNr(nr: $facultyID){ universityByDoctoraldegreefrom { graduatestudentsByUndergraduatedegreefrom{ - nodes { nr emailaddress } - } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT10.txt b/artifacts/queryTemplates/main-PostGraphile/QT10.txt index dbf3114..c529154 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT10.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT10.txt @@ -1,10 +1,8 @@ query stringMatching($keyword:String) { - allPublications(filter: {title: {includes: "$keyword"}}) { - nodes { + allPublicationsList(filter: {title: {includes: $keyword}}) { nr title abstract - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT11.txt b/artifacts/queryTemplates/main-PostGraphile/QT11.txt index 4db7c5c..1c25bbb 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT11.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT11.txt @@ -1,11 +1,9 @@ query subquerySearch($universityID:ID) { - allGraduatestudents(condition: {undergraduatedegreefrom: $universityID}) { - nodes { + allGraduatestudentsList(condition: {undergraduatedegreefrom: $universityID}) { nr professorByAdvisor { nr } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT12.txt b/artifacts/queryTemplates/main-PostGraphile/QT12.txt index 0bc3255..b5a746b 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT12.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT12.txt @@ -1,18 +1,12 @@ -query subqueryFilter1($universityID:ID, $departmentID:ID) +query subqueryFilter1($universityID:ID!, $departmentID:ID) { - allUniversities(condition: {nr: $universityID}) { - nodes { - facultiesByDoctoraldegreefrom(condition: {worksfor: $departmentID}) { - nodes { + universityByNr(nr: $universityID) { + facultiesByDoctoraldegreefromList(condition: {worksfor: $departmentID}) { nr emailaddress - publicationsByMainauthor { - nodes { + publicationsByMainauthorList { nr - } } - } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT15.txt b/artifacts/queryTemplates/main-PostGraphile/QT15.txt index 68e5e4f..7b40060 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT15.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT15.txt @@ -1,10 +1,8 @@ -query count_query ($universityID:ID) +query count_query ($universityID:ID!) { - allUniversities(condition: {nr: $universityID}) { - nodes { + universityByNr(nr: $universityID) { graduatestudentsByUndergraduatedegreefrom { totalCount } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT2.txt b/artifacts/queryTemplates/main-PostGraphile/QT2.txt index 869eb65..152e438 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT2.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT2.txt @@ -1,16 +1,10 @@ -query university_faculty_publications($universityID:ID) +query university_faculty_publications($universityID:ID!) { - allUniversities(condition: {nr: $universityID}) { - nodes { - facultiesByDoctoraldegreefrom { - nodes { - publicationsByMainauthor { - nodes { + universityByNr(nr: $universityID) { + facultiesByDoctoraldegreefromList { + publicationsByMainauthorList { title - } } - } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT3.txt b/artifacts/queryTemplates/main-PostGraphile/QT3.txt index 14f1242..519d67c 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT3.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT3.txt @@ -1,10 +1,8 @@ -query researchGroup_department_head_doctorDegreeFrom($researchGroupID:ID) +query researchGroup_department_head_doctorDegreeFrom($researchGroupID:ID!) { - allResearchgroups(condition: {nr: $researchGroupID}) { - nodes { + researchGroupByNr(nr: $researchGroupID) { departmentBySuborganizationof { - professorsByHeadof { - nodes { + professorsByHeadofList { facultyByNr { nr emailaddress @@ -12,9 +10,7 @@ query researchGroup_department_head_doctorDegreeFrom($researchGroupID:ID) nr } } - } } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT4.txt b/artifacts/queryTemplates/main-PostGraphile/QT4.txt index 90e7132..6e6024a 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT4.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT4.txt @@ -1,12 +1,10 @@ -query lecturer_university_graduateStudent_professor_department($lecturerID:ID) +query lecturer_university_graduateStudent_professor_department($lecturerID:ID!) { - allLecturers(condition: {nr: $lecturerID}) { - nodes { + lecturerByNr(nr: $lecturerID) { facultyByNr { universityByDoctoraldegreefrom { nr - graduatestudentsByUndergraduatedegreefrom { - nodes { + graduatestudentsByUndergraduatedegreefromList { nr emailaddress professorByAdvisor { @@ -18,10 +16,8 @@ query lecturer_university_graduateStudent_professor_department($lecturerID:ID) } } } - } } } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT5.txt b/artifacts/queryTemplates/main-PostGraphile/QT5.txt index 1f61131..363c61b 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT5.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT5.txt @@ -1,31 +1,25 @@ -query department_faculty_university_graduateStudents_department($departmentID:ID) +query department_faculty_university_graduateStudents_department($departmentID:ID!) { - allDepartments(condition: {nr: $departmentID}) { - nodes { + departmentByNr(nr: $departmentID) { universityBySuborganizationof { nr - graduatestudentsByUndergraduatedegreefrom { - nodes { + graduatestudentsByUndergraduatedegreefromList { nr emailaddress departmentByMemberof { nr universityBySuborganizationof { nr - graduatestudentsByUndergraduatedegreefrom { - nodes { + graduatestudentsByUndergraduatedegreefromList { nr emailaddress departmentByMemberof { nr } - } } } } - } } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT6.txt b/artifacts/queryTemplates/main-PostGraphile/QT6.txt index 9e96492..de6bcd7 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT6.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT6.txt @@ -1,9 +1,7 @@ -query university_graduateStudents_supervisor_department($universityID:ID) +query university_graduateStudents_supervisor_department($universityID:ID!) { - allUniversities(condition: {nr: $universityID}) { - nodes { - graduatestudentsByUndergraduatedegreefrom { - nodes { + universityByNr(nr: $universityID) { + graduatestudentsByUndergraduatedegreefromList { professorByAdvisor { facultyByNr { departmentByWorksfor { @@ -11,8 +9,6 @@ query university_graduateStudents_supervisor_department($universityID:ID) } } } - } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT7.txt b/artifacts/queryTemplates/main-PostGraphile/QT7.txt index 9db8705..6f0a3e0 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT7.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT7.txt @@ -1,14 +1,10 @@ -query paging_with_offset_as_counter($universityID:ID, $offset:Int) +query paging_with_offset_as_counter($universityID:ID!, $offset:Int) { - allUniversities(condition: {nr: $universityID}) { - nodes { + univserityByNr(nr: $universityID) { graduatestudentsByUndergraduatedegreefrom(first: 10, offset: $offset) { - nodes { professorByAdvisor { nr } - } } - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT8.txt b/artifacts/queryTemplates/main-PostGraphile/QT8.txt index 6489ba3..27431be 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT8.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT8.txt @@ -1,10 +1,8 @@ -query sorting_with_paging($cnt:Int, $attrGStudent1PostGraphile: GraduatestudentsOrderBy, $attrGStudent2PostGraphile: GraduatestudentsOrderBy) +query sorting_with_paging($cnt:Int, $attrGStudent1PostGraphile: GraduatestudentsOrderBy!, $attrGStudent2PostGraphile: GraduatestudentsOrderBy!) { - allGraduatestudents(first:$cnt, orderBy: [ $attrGStudent1PostGraphile, $attrGStudent2PostGraphile ]) { - nodes { + allGraduatestudentsList(first:$cnt, orderBy: [ $attrGStudent1PostGraphile, $attrGStudent2PostGraphile ]) { nr telephone emailaddress - } } } diff --git a/artifacts/queryTemplates/main-PostGraphile/QT9.txt b/artifacts/queryTemplates/main-PostGraphile/QT9.txt index 733bcf0..ff23e31 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT9.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT9.txt @@ -1,20 +1,14 @@ -query paging_and_sorting($universityID:ID, $attrPublicationFieldPostGraphile:PublicationsOrderBy) +query paging_and_sorting($universityID:ID!, $attrPublicationFieldPostGraphile:PublicationsOrderBy) { - allUniversities(condition: {nr: $universityID}) { - nodes { - graduatestudentsByUndergraduatedegreefrom(first: 50) { - nodes { + universityByNr(nr: $universityID) { + graduatestudentsByUndergraduatedegreefromList(first: 50) { professorByAdvisor { facultyByNr { - publicationsByMainauthor(orderBy: $attrPublicationFieldPostGraphile) { - nodes { + publicationsByMainauthorList(orderBy: $attrPublicationFieldPostGraphile) { nr - } } } } - } } - } } } From 55cd2be97eaad90cba95af58d7fe8bb848d1474f Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 12 Dec 2022 10:01:42 +0000 Subject: [PATCH 2/2] Forgot to rename a field --- artifacts/queryTemplates/main-PostGraphile/QT1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/queryTemplates/main-PostGraphile/QT1.txt b/artifacts/queryTemplates/main-PostGraphile/QT1.txt index d137064..99031e4 100644 --- a/artifacts/queryTemplates/main-PostGraphile/QT1.txt +++ b/artifacts/queryTemplates/main-PostGraphile/QT1.txt @@ -2,7 +2,7 @@ query faculty_university_graduateStudent($facultyID:ID!) { facultyByNr(nr: $facultyID){ universityByDoctoraldegreefrom { - graduatestudentsByUndergraduatedegreefrom{ + graduatestudentsByUndergraduatedegreefromList{ nr emailaddress }