SSWConsulting / SSWConsulting/SSW.Website

💸 Tech Debt - Write GraphQL queries that only get the data we need

Open
#620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
14
Forks
10
Avg merge
13h 51m
Merged PRs (30d)
38

Description

Description
Right now we are using the generated queries from TinaCMS. These include all the data for the collection we are querying.
sometimes we only use a small subset of this data, and have to strip it out after the query.
Also for some pages we need to do multiple queries.

Proposed solution
Change queries to only get the data we need, reducing the complexity of the logic in components.
If we are doing multiple queries, it might be better to write one query that gets both datasets.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the generated TinaCMS GraphQL queries and the components that strip unused fields after querying. Identify pages making multiple queries and compare the requested fields with the data they use; done means queries request only needed data and related datasets are combined where appropriate without changing page behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, nextjs
Domain
api, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.