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

(docs) Consider moving/removing fragments section of GraphQL API #21109

Closed
tesseralis opened this issue Jan 31, 2020 · 0 comments
Closed

(docs) Consider moving/removing fragments section of GraphQL API #21109

tesseralis opened this issue Jan 31, 2020 · 0 comments
Assignees
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@tesseralis
Copy link
Contributor

tesseralis commented Jan 31, 2020

Summary

Consider moving the "Fragments" section of the GraphQL API to its own page(s). Alternately, remove these sections, since their content is already covered under the Gatsby Image API.

Motivation

The "Fragments" section contains GraphQL fragments for two plugins: Contentful and ImageSharp. It makes them hard to find when they're hidden at the bottom of the GraphQL API.

Additionally, this requires us to pull in a one-time use MDX component, <GraphQLApiQuery>, which can interfere with translated docs. There are other work-arounds for this, like making the component global

Furthermore, the static-query used is included in the main site bundle for some reason, resulting in significant bloat for the site (#21470). 10% of our main website bundle comes from these queries! Moving them to page queries, or removing them alltogether, alleviates this.

Steps to resolve this issue

  • Create a new overview page "GraphQL Fragments" that introduces the concept of fragments and links to the two pages below.
  • Create two new pages "Contentful Fragments" and "ImageSharp Fragments", each pulling in the APIs for the specific plugin using the new template-api defined in feat(www): Convert API pages to MDX #20763

Related Issues

Part of: #20795
Depends on: #20763

@tesseralis tesseralis added type: documentation An issue or pull request for improving or updating Gatsby's documentation topic: i18n labels Jan 31, 2020
@tesseralis tesseralis added the type: question or discussion Issue discussing or asking a question about Gatsby label Feb 10, 2020
@tesseralis tesseralis changed the title (docs) Consider moving fragments section of GraphQL API to their own page (docs) Consider moving/removing fragments section of GraphQL API Feb 17, 2020
@LekoArts LekoArts removed the type: question or discussion Issue discussing or asking a question about Gatsby label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants