Skip to content

Gatsby source plugin for fetching data from MyMiniFactory API

Notifications You must be signed in to change notification settings

MyMiniFactory/gatsby-source-mmf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-mmf

This plugin sets up source for Gatsby application fetching data from MyMiniFactory API

Install plugin

To install the plugin, follow these steps.

  1. Gatsby loads plugins from the your local website plugins folder which is a folder named plugins in the website’s root directory. So place the plugin folder inside it.

  2. Ensure that npm is installed. This provides dependencies to run the plugin.

  3. From the plugin folder, execute the following command:

npm install

Configure the plugin

Open gatsby-config.js from the root directory of your project site, and add the gatsby-source-mmf plugin inside plugin table:

plugins: [
  ...,
  {
    resolve: "gatsby-source-mmf",
    options: {
      name: "MyMiniFactoryObject",
      url: "https://www.myminifactory.com/api/v2/search",
      key: <API-KEY>,
      cat: "112",
      per_page: "23",
      light: "1",
      sort: "popularity",
    },
  },
]

Query for result

Your plugin is ready. Start gatsby develop and open a browser at http://localhost:8000/___graphql. The MyMiniFactory data can be queried from here. try:

query MyQuery {
  allMyMiniFactoryObject {
    edges {
      node {
        id
        url
        name
      }
    }
  }
}

About

Gatsby source plugin for fetching data from MyMiniFactory API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published