This plugin sets up source for Gatsby application fetching data from MyMiniFactory API
To install the plugin, follow these steps.
-
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. -
Ensure that npm is installed. This provides dependencies to run the plugin.
-
From the plugin folder, execute the following command:
npm install
Open gatsby-config.js
from the root directory of your tutorial site, and add the gatsby-source-mmf-map plugin inside plugin table:
plugins: [
...,
{
resolve: "gatsby-source-mmf-map",
options: {
name: "MapTile",
url: "https://www.myminifactory.com/stw/objects/map",
},
},
]
Your plugin is ready. Start gatsby develop
and open a browser at http://localhost:8000/___graphql. The map tile data can be queried from here. try:
query MyQuery {
allMapTileObject {
edges {
node {
id
}
}
}
allMapTilePlace {
edges {
node {
id
}
}
}
}