-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GraphQL Queries with Pagination #3064
base: master
Are you sure you want to change the base?
Conversation
Release Note:Update GraphQL Queries with Pagination Affected Apps: Student, Teacher
|
refs: MBL-18026 affects: Student, Teacher release note: Update GraphQL Queries with Pagination
Could you please doublecheck that you cover all changes/additions with unit tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on getting the foundations ready for this! I think on the comment library and on the share extensions's assignment list we should use exhaust because there are logics working on local filtering / selecting from the list.
- On SpeedGrader's comment list there's a local filtering for the word entered into the comment library's text field so we should know all entries to be able to locally filter the list. At the moment on my account I have more than 20 items (page size is 20) and when I first enter a keyword the filtering finds it despite I didn't scroll to the 2nd page. I think this is some glitch that makes it automatically download the 2nd page. The filtering not working correctly is visible when you have something already entered into the field and you open the dialog a second time.
ScreenRecording_01-31-2025.11-19-40_1.MP4
- The share extensions's assignment list should pre-select the course and assignment if a file from the student app is being shared. A common scenario that a student opens a pdf from a course, annotates it inside the app and submits back to an assignment right away. In this scenario the extension won't find the assignment if it's not on the first page of the result list.
For lists that include filtering, I think in order to utilize paging the proper way, we need to make use of some "query" argument on the GraphQL functions to do that on server and remove logic of filtering locally. |
I am not sure I understood this point, assignments list shown on share extension requires that assignments have submission type of "online_upload" enabled for them. Those having only "student_annotation" enabled for them, will get filtered out locally. Unfortunately, GraphQL function for course assignments doesn't have the option to filter against submission types. So, perhaps, we would need to get back to using exhaust for this in particular. |
Yes, that would be the ideal solution but if such query is not available we can still do an exhaust and filter locally. One comment library use-case is definitely broken with the current solution so we have to do something about it.
Here a video of the automatic assignment selection feature that I think won't work if the assignment is on the second page. ScreenRecording_02-03-2025.10-36-26_1.MP4 |
More unit tests are coming to increase the coverage. |
refs: MBL-18026
affects: Student, Teacher
release note: Update GraphQL Queries with Pagination.
What's Changed
All GraphQL queries used to fetch a list of items were modified to include paging, and those are:
1- Teacher's Comments Library for Assignment Submission.
Request type:
APICommentLibraryRequest
Used in Teacher app.
2- Assignment Picker List of Submit Assignment Extension.
Request type:
AssignmentPickerListRequest
Used in "SubmitAssignment" extension of Student app.
3- Settings page course sections list of Assignment Submissions List.
GetAssignmentPostPolicyInfoRequest
type was splitted into two separate requests:A.
GetPostPolicyCourseSectionsRequest
: was modified to include paging.B.
GetPostPolicyAssignmentSubmissionsRequest
: paging was not included, because it was used to calculate counts rather than presenting information of submissions.Used in Teacher app.
Paging Logic
New main types were introduced to encapsulate paging logic for both UIKit and SwiftUI contexts:
PagingButton
- SwiftUI View to be added to the very bottom of the list.In UIKit context, to handle paging in UITableView, you need to consider the following ones.
Paging<C>
- A presenter object used to handle paging logic inUITableView
instances, you need to create one per a table view.PageLoadingCell
- A cell that can be dequeued in UITableView with loading & call-to-action variations, to be shown based on the logic encapsulated in thePaging
instance associated with.Test Plan
1 - Teacher's Comments Library:
2 - Assignment Picker List of Submit Assignment Extension.
3- Settings page course sections list of Assignment Submissions List.
Note:
"List loading in pages" means that you get to notice loading indicator when you scroll to the very bottom of it, if loading failed "Load More" button is shown to allow user to try fetching again.
Video Recordings
1- Comments Library
case1_comments_library.mp4
2- Assignment Picker List
case2_post_policy.mp4
3- Post Policy Settings Page
case2_post_policy_edit0.mov
Checklist