Skip to content

POC: GraphQL Startup.js

Natalia Tepluhina requested to merge ntepluhina-graphql-startup-js-2 into master

What does this MR do?

I moved a single query for fetching last commit information to the HAML file. This call is resolved on the root JS file for repository and the result is written to Apollo Client cache. This change allows us to render the Largest Contentful Paint (which is LastCommit Vue application) significantly faster: before it was ~3200ms, after it's ~2400ms (based on 5 performance snapshots for each)

Screenshot_2020-07-09_at_13.35.44

Issues

Sending a GraphQL query early adds a few issues that need to be resolved:

  • thanks to @johnhope we're parsing .graphql files now but
    • we're unable to parse files with fragments for now;
    • we need to add __typename field to every type on these queries (Apollo Client does this automatically on the frontend and we need queries to be 100% identical)
Edited by Natalia Tepluhina

Merge request reports