Skip to content
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

GraphQL schema for exercises aggregated by week #27

Merged
merged 11 commits into from
Mar 29, 2024

Conversation

VathsalaAchar
Copy link
Owner

@VathsalaAchar VathsalaAchar commented Mar 28, 2024

Added new Query for GraphQL endpoint: statsAggregatedByWeek and a resolver. This returns the aggregated data by week for the journal page. Also updated journal page to use the GraphQL endpoint.

Other smaller changes:

  • Distance field changed to float in GraphQL schema
  • updated rest endpoint weekly_user_stats to use common query code
  • Added name to the GraphQL query in statistics page following gql query best practices [1]
  • Also added a test - this one returns 200 status code but is having trouble returning data possibly due to dates. I've left it in to try again later.
Screenshot 2024-03-28 at 18 57 59

Also visible from the graphql playground on localhost/stats/graphql is the graphql schema

Screenshot 2024-03-29 at 10 04 11

Source:
[1] GQL query best practices

- includes changes to journal and statistics pages to access the right data as response.data.data (redundant but it is how graphql server returns data)
- updated tests to use new path to access stats
Copy link
Collaborator

@HarshiSharma HarshiSharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work as always @VathsalaAchar !!

@VathsalaAchar VathsalaAchar merged commit a8aabbd into main Mar 29, 2024
2 checks passed
@VathsalaAchar VathsalaAchar deleted the graphql-schema-for-weekly-data branch April 1, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants