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) Remove jsdoc for graphql fragments in GraphQL API #21811

Merged
merged 4 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions docs/docs/graphql-api.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.