-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Add pagination support to EventsByOrganization query #2319
Comments
@aashimawadhwa @rishav-jha-mech @DMills27 PTAL and comment |
@xoldd This was discussed frequently in the past, however related to news feeds. PTAL too |
@palisadoes For the mobile part the UI should be tweaked to accomodate the pagination. |
Both the admin and mobile will need to be updated simultaneously according to the changes in the API. We'll need contributors for both. Would depend on how the query is modified in the backend. A proper approach should be established first. |
|
I've documented the standard approach to be followed throughout talawa-api for implementing pagination using the graphql connections:- https://docs.talawa.io/docs/developers/talawa-api/pagination
Again, REST like patterns should not to be followed with graphql, relationships and fetching patterns should be expressed in the graph. This is an anti-pattern:- type Query {
eventsByOrganization(organizationID: ID!): EventsConnection
} The events associated to an organization should be exposed like this:- type Organization {
events: EventsConnection
} On the client side querying for the events within an organization would look like this:- type OrganizationEventsQuery($cursor: String, $limit: Int!, $organizationID: ID!) {
organization(id: $organizationID) {
address
phoneNumber
events(first: $limit, after: $cursor) {
edges {
cursor
node {
id
...other event fields
}
}
pageInfo {
... fields
}
}
}
name
} The advantage here is that you can fetch other fields like When the next set of events are to be fetched(connection is to be traversed further) a new network request would be made with a non-null value for the type OrganizationEventsQuery($cursor: String, $limit: Int!, $organizationID: ID!) {
organization(id: $organizationID) {
events(first: $limit, after: $cursor) {
edges {
cursor
node {
id
...other event fields
}
}
pageInfo {
... fields
}
}
}
} To understand how the client implementation would work, take a read:-
|
Yes we already use a similar approach in |
@Azad99-9 Are you working on this? |
@palisadoes I am not working on this. But this needs to be addressed. To resolve client side performance issues. |
Should I do it? |
Yes kindly do it. Thanks. |
hey, is this issue up? can i be assigned to do this?. |
@Maniii97 Thank you for your interest. Please keep looking, as I'm sure we have open issues and we'd love your help. If any issue is already assigned, please don't ask to be assigned. We want everyone to get a chance. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Please assign me this issue, I would like to work on this. |
@xoldd Are you working on this? |
I had made a PR that incorporated the required changes but it was failing the prettier formatting test which I wasn't able to fix on my local system. So, Peter closed the PR. I'm currently not working on this anymore so you can assign it to @AnshulKahar2729. @AnshulKahar2729 You can reference my PR and make a similar PR. |
Ok I will do that |
Working on this... Will soon raise a PR. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Working.... |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
working |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Working on this... I am just solving another issue too. |
Unassigning. Inactivity |
can i work on this issue? @palisadoes |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
unassigning. inactivity |
Hey @palisadoes, |
Hi @palisadoes, Proposed Steps: Thank you! |
During the week of November 11, 2024 we will start a code freeze on the We have completed a project to convert the Talawa-API backend to use PostgreSQL. Work will then begin with us merging code in the Planning activities for this will be managed in our #talawa-projects slack channel. A GitHub project will be created to track specially labeled issues. We completed a similar exercise last year using a similar methodology. Starting November 12, California time no new PRs will be accepted against the There are some GSoC project features that will need to be merged into develop. These will be the only exceptions. This activity and the post GSoC 2024 start date was announced in our #general Slack channel last month as a pinned post. |
Is your feature request related to a problem? Please describe.
Currently the
EventsByOrganization
query fetches all event entries at once.The number of event entries in the database has drastically increased after adding the Recurring events feature. This has resulted in slow API fetching times.
Describe the solution you'd like
Implement pagination for EventsByOrganization. This will allow fetching events in smaller, manageable sets based on user needs (e.g., number of events per page).
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Approach to be followed (optional)
A clear and concise description of approach to be followed.
Additional context
Add any other context or screenshots about the feature request here.
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship PalisadoesFoundation/talawa#359
The text was updated successfully, but these errors were encountered: