Skip to content

Commit

Permalink
Adds FAQ section (#10)
Browse files Browse the repository at this point in the history
* Adds FAQ section

Includes a fix to the error related to GraphQL not able to find subfields from the image key
  • Loading branch information
kinduff authored and danielmahon committed Nov 14, 2018
1 parent 9661f24 commit 885ae00
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,49 @@ exports.onCreateNode = ({ node }) => {
fmImagesToRelative(node);
};
```

### FAQ

### I'm getting the error: Field "image" must not have a selection since type "String" has no subfields
This is a common error when working with Netlify CMS (see issue [gatsby/gatsby#5990](https://github.com/gatsbyjs/gatsby/issues/5990)).

The application must include the `media` with `gatsby-source-filesystem` to include all the uploaded media and to make it available on build time. **Note:** The media folder must be included **before** the other content.

For example, an application that is using NetlifyCMS and this plugin, and has a content folder with markdown that comes from Netlify. Here's how the `gatsby-config.js` should look like:

```js
module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/static/assets`,
name: 'assets',
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/content`,
name: 'content',
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-remark-relative-images`,
{
resolve: `gatsby-remark-images`,
options: {},
},
],
},
},
`gatsby-plugin-netlify-cms`,
],
}
```

0 comments on commit 885ae00

Please sign in to comment.