Skip to content

Commit

Permalink
(docs) Remove jsdoc for graphql fragments in GraphQL API (#21811)
Browse files Browse the repository at this point in the history
* Remove jsdoc for graphql fragments

* remove docstaticqueries

* Update packages/gatsby-image/README.md

Co-Authored-By: Kyle Gill <kylerobertgill@gmail.com>

Co-authored-by: Kyle Gill <kylerobertgill@gmail.com>
Co-authored-by: GatsbyJS Bot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
3 people committed Feb 28, 2020
1 parent 12324a8 commit 068ef1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 89 deletions.
37 changes: 2 additions & 35 deletions docs/docs/graphql-api.md
Expand Up @@ -3,9 +3,6 @@ title: GraphQL API
tableOfContentsDepth: 2
---

import { GraphqlApiQuery } from "../../www/src/components/api-reference/doc-static-queries"
import APIReference from "../../www/src/components/api-reference"

A great advantage of Gatsby is a built-in data layer that combines all data sources you configure. Data is collected at [build time](/docs/glossary#build) and automatically assembled into a [schema](/docs/glossary#schema) that defines how data can be queried throughout your site.

This doc serves as a reference for GraphQL features built into Gatsby, including methods for querying and sourcing data, and customizing GraphQL for your site's needs.
Expand Down Expand Up @@ -227,39 +224,9 @@ Fragments allow you to reuse parts of GraphQL queries. They also allow you to sp

For more information, check out the docs guide on [using fragments in Gatsby](/docs/using-graphql-fragments/).

### List of Gatsby fragments

Some fragments come included in Gatsby plugins, such as fragments for returning optimized image data in various formats with `gatsby-image` and `gatsby-transformer-sharp`, or data fragments with `gatsby-source-contentful`.

#### Image sharp fragments

The following fragments are available in any site with `gatsby-transformer-sharp` installed and included in your `gatsby-config.js`.

Information on querying with these fragments is also listed in-depth in the [Gatsby image API docs](/docs/gatsby-image/), including options like resizing and recoloring.

<GraphqlApiQuery>
{data => (
<APIReference
relativeFilePath={data.transformerSharp.nodes[0].relativePath}
docs={data.transformerSharp.nodes[0].childrenDocumentationJs}
/>
)}
</GraphqlApiQuery>

#### Contentful fragments

The following fragments are available in any site with `gatsby-source-contentful` installed and included in your `gatsby-config.js`. These fragments generally mirror the fragments outlined in the `gatsby-transformer-sharp` package.

<GraphqlApiQuery>
{data => (
<APIReference
relativeFilePath={data.contentfulFragments.nodes[0].relativePath}
docs={data.contentfulFragments.nodes[0].childrenDocumentationJs}
/>
)}
</GraphqlApiQuery>
### Gatsby fragments

**Note**: the above fragments are from officially maintained Gatsby starters; other plugins like `gatsby-source-datocms` and `gatsby-source-sanity` ship with fragments of their own. A list of those fragments can be found in the [`gatsby-image` README](/packages/gatsby-image#fragments).
Some fragments come included in Gatsby plugins, such as fragments for returning optimized image data in various formats with `gatsby-image` and `gatsby-transformer-sharp`, or data fragments with `gatsby-source-contentful`. For more information on what plugins include fragments, see the [`gatsby-image` README](/packages/gatsby-image#fragments).

## Advanced customizations

Expand Down
5 changes: 3 additions & 2 deletions packages/gatsby-image/README.md
Expand Up @@ -253,8 +253,6 @@ Their fragments are:
- `GatsbySanityImageFluid`
- `GatsbySanityImageFluid_noBase64`

_Links to source code for fragment fields of official Gatsby plugins can be found in the [Gatsby GraphQL API](/docs/graphql-api/)_

If you don't want to use the blur-up effect, choose the fragment with `noBase64`
at the end. If you want to use the traced placeholder SVGs, choose the fragment
with `tracedSVG` at the end.
Expand All @@ -263,6 +261,9 @@ If you want to automatically use WebP images when the browser supports the file
format, use the `withWebp` fragments. If the browser doesn't support WebP,
`gatsby-image` will fall back to the default image format.

For more information about these options, please see the
[Gatsby Image API](/docs/gatsby-image/#image-query-fragments).

_Please see the
[gatsby-plugin-sharp](/packages/gatsby-plugin-sharp/#tracedsvg)
documentation for more information on `tracedSVG` and its configuration
Expand Down
52 changes: 0 additions & 52 deletions www/src/components/api-reference/doc-static-queries.js

This file was deleted.

0 comments on commit 068ef1b

Please sign in to comment.