Skip to content

Commit 2b8c2f2

Browse files
KyleAMathewsDSchauLekoArts
authored
fix(docs): Update the create a source plugin tutorial (#36862)
Co-authored-by: Dustin Schau <[email protected]> Co-authored-by: Lennart <[email protected]>
1 parent 412c65f commit 2b8c2f2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/docs/how-to/plugins-and-themes/creating-a-source-plugin.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@ tableOfContentsDepth: 2
55

66
import { Announcement } from "gatsby-interface"
77

8+
Source plugins are reusable integrations with content and data backends. There are already [100s of ready-to-use source plugins for popular content APIs](/plugins/?=gatsby-source) like Contentful, Drupal, and WordPress. This tutorial teaches you how to build your own integration.
9+
810
In this tutorial, you'll create your own source plugin that will gather data from an API. The plugin will source data, optimize remote images, and create foreign key relationships between data sourced by your plugin.
911

1012
## What is a source plugin?
1113

12-
Source plugins "source" data from remote or local locations into what Gatsby calls [nodes](/docs/reference/graphql-data-layer/node-interface/). This tutorial uses a demo API so that you can see how the data works on both the frontend and backend, but the same principles apply if you would like to source data from another API.
14+
Source plugins fetch data from remote or local services and write the data into the embedded Gatsby Database (powered by [LMDB](https://github.com/kriszyp/lmdb-js)).
1315

1416
At a high-level, a source plugin:
1517

16-
- Ensures local data is synced with its source and is 100% accurate.
17-
- Creates [nodes](/docs/reference/graphql-data-layer/node-interface/) with accurate media types, human-readable types, and accurate
18-
[contentDigests](/docs/reference/graphql-data-layer/node-interface/#contentdigest).
19-
- Links nodes & creates relationships between them.
20-
- Lets Gatsby know when nodes are finished sourcing so it can move on to processing them.
18+
- Ensures the data in the Gatsby DB is synced with the latest updates from its source
19+
- Creates [nodes](/docs/reference/graphql-data-layer/node-interface/) (Gatsby's name for an object) with accurate media types, human-readable types, and accurate
20+
[contentDigests](/docs/reference/graphql-data-layer/node-interface/#contentdigest)
21+
- Creates relationships between nodes
2122

2223
A source plugin is a regular npm package. It has a `package.json` file, with optional dependencies, as well as a [`gatsby-node.js`](/docs/reference/config-files/gatsby-node/) file where you implement Gatsby's Node APIs. Read more about [files Gatsby looks for in a plugin](/docs/files-gatsby-looks-for-in-a-plugin/) or [creating a generic plugin](/docs/how-to/plugins-and-themes/creating-a-generic-plugin).
2324

2425
## Why create a source plugin?
2526

26-
Source plugins convert data from any source into a format that Gatsby can process. Your Gatsby site can use several source plugins to combine data in interesting ways.
27+
Source plugins make data from any source available to your Gatsby sites. Your Gatsby site can use several source plugins, like commerce data from Shopify, or content from one or more content management systems (like Contentful, WordPress, etc.), all in a unified graph.
2728

2829
There may not be [an existing plugin](/plugins/?=gatsby-source) for your data source, so you can create your own.
2930

0 commit comments

Comments
 (0)