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

Fixing multiple speed issues with Graph QL and SSR #836

Merged
merged 7 commits into from
Dec 20, 2023
Merged

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Dec 7, 2023

Description

As GraphQL batches queries together. Slower queries slow down the rest. I created a way where we can choose if a query gets batched or not.

The GraphQL client server is running with the fetch policy "Cache and Network", this is so it checks the cache first to see if there's data but also sends a network request to see if there is updated data. If I switched this to "Cache first", it loads in the cache first, and if found, it doesn't do a network refetch. However, it can cause issues as data may have been updated and the user won't see it.

Also updated the Dashboard to no longer be SSR. This saves some time when loading the page. The reason it was SSR in the first place was to make the animations look great, but it isn't needed, and I added some impersonator logic, which I don't think we need. I need to double-check this on staging.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@dr-bizz dr-bizz added the On Staging Will be merged to the staging branch by Github Actions label Dec 7, 2023
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-836.d3dytjb8adxkk5.amplifyapp.com

@dr-bizz dr-bizz requested a review from caleballdrin December 15, 2023 14:50
Copy link
Contributor

@caleballdrin caleballdrin left a comment

Choose a reason for hiding this comment

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

Looks good!

@dr-bizz dr-bizz merged commit 7fbede2 into main Dec 20, 2023
14 of 15 checks passed
@dr-bizz dr-bizz deleted the speed-issues branch December 20, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Staging Will be merged to the staging branch by Github Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants