Skip to content

add FXIOS-123 {Return member object} Returns member object in attendance and status update history #127

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

Harshith-2208
Copy link
Contributor

closes #123
I have added two new struct in attendance.rs which are AttendanceMemberRow which is a row and AttendanceWithMember which creates an object similarly two new struct in streak_update.rs. Then they are implemented in queries, a vector of rows matching the query are created having both the fields of attendance and member as flat rows then a new struct AttendanceWithMember for each r in rows then returns the vector
Screenshot From 2025-06-07 00-35-38
Screenshot From 2025-06-07 00-36-29

@chimnayajith
Copy link
Contributor

chimnayajith commented Jun 6, 2025

Thanks for the PR @Harshith-2208

Currently the PR has 4 separate commits, but they're all working towards a single change, and some of them seem like fixups or partial changes. Before going into the review of the content it would be great if you could clean up the commit history by squashing everything into one clear commit.

@Harshith-2208
Copy link
Contributor Author

Done with squashing them can go ahead with reviewing.

@chimnayajith
Copy link
Contributor

@Harshith-2208 From a quick look, it seems like the PR is adding a bit more complexity than what might be needed for the feature. I see you’ve added new types (AttendanceMemberRow, AttendanceWithMember) and SQL joins to include member data, which works, but might be a bit heavy.

An alternative approach that might simplify things is to use a GraphQL field resolver instead of joining everything up front:
We could keep the existing Attendance struct. Then use #[ComplexObject] from async-graphql to define a member field as a resolver. That way, member data is only fetched when the client asks for it

This can help keep the schema clean and reduce the amount of SQL wiring.

Here’s the #[ComplexObject] doc for reference:
https://docs.rs/async-graphql/latest/async_graphql/attr.ComplexObject.html

Not 100% sure this is the best route, but it might be worth considering.

@Harshith-2208
Copy link
Contributor Author

Updated the code using ComplexObject

@Harshith-2208 Harshith-2208 force-pushed the issue branch 4 times, most recently from e111e13 to 69091e2 Compare June 11, 2025 13:17
@hrideshmg hrideshmg merged commit 021e423 into amfoss:develop Jun 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace memberid in the attendance and status update history queries with the member object
3 participants