Devographics / Devographics/Monorepo

Results data-fetching overview

Open
#244 0 comments 0 reactions 0 assignees View on GitHub
results
Dominant language
TypeScript
Stars
178
Forks
55
Avg merge
1m
Merged PRs (30d)
2

Description

An overview of how `results` gets its data:

- Gatsby goes through each chart one by one during its build process.
- For each chart, it looks for an existing `chartId.json` file A) on the local disk or B) at a predefined [URL](https://devographics.github.io/surveys/state_of_js/js2022/results/data/front_end_frameworks/qwik.json).
- If the file exists, it uses that.
- If not, it generates a GraphQL query and runs it against the API.

If running locally in dev mode:

- the build process also creates a JSON file containing the results of the API call
- I then commit the updated data as part of the `surveys` repo and push it to GitHub.

### Why

Two reasons why we rely on "static" files:

- Loading a file is way faster than hitting an API, even if the result is cached.
- In the event of the API going down or not running in the future or whatever reason, we can still rebuild the results site with nothing but the JSON files.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue does not name a documentation file or requested change. Start by reviewing the linked example JSON URL and the described results build flow, including the local disk, predefined URL, GraphQL API, and committed surveys data paths. Done should be a clearly located overview covering this fallback process and its rationale.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, graphql, typescript
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.