justinwhall / wordpress-gatsby-preview-starter

A starter for WordPress + Gatsby that supports live previews
https://justinwhall.com
85 stars 10 forks source link

Build failling, because of GraphQL error inside the WPGraphQL docs? #8

Open iaremarkus opened 4 years ago

iaremarkus commented 4 years ago

Thanks for your work on this Justin :)

I'm getting a really weird build error through:

Failed to compile
GraphQL Error Encountered 2 error(s):
- Unknown field 'siteName' on type 'SiteSiteMetadata'. Source: document `applicationsMampHtdocsMysiteGatsbyThemeThemePluginsWpGraphqlDocsSrcGatsbyThemeApolloDocsComponentsPageLayoutJs1018970335` file: `GraphQL request`

  GraphQL request:6:13
  5 |             title
  6 |             siteName
    |             ^
  7 |             subtitle
- Unknown field 'childMdx' on type '[File!]!'.

      file: /Applications/MAMP/htdocs/mysite-gatsby-theme/theme/plugins/wp-graphql/docs/src/gatsby-theme-apollo-docs/components/template.js

This error occurred during the build time and cannot be dismissed.

Why is my code in ./site, worrying about GraphQL errors in the WordPress theme's plugin?

Hope you can help. Pulling my hair out here :(

justinwhall commented 4 years ago

👋 @wondergryphon – Hard to say without seeing more of what is going on. One thing does stick out. I see your file path is that of MAMP. This repo uses docker and doesn't need MAMP so I'm a bit confused on your setup. Is it possible you have a Gatsby theme in a MAMP directory? You have a repo or a bit more info?

iaremarkus commented 4 years ago

Heya @justinwhall thanks for the reply :)

Yeah I put all my projects inside htdocs, even though MAMP isn't always the platform used. So MAMP wasn't running here, my Docker instance was.

Basically I wanted to prove the concept to myself that I could use your Beers example to createPages with my own CPT. So I worked through various issues with my own code, CPT setup and GraphQL etc until finally I wasn't getting errors in my own code, but now the build fails because of GraphQL errors in the WPGraphQL documentation?

Just seems super weird that it's looking there in the first place?

justinwhall commented 4 years ago

I'm still trying to understand how this is all structured in terms of the filesystem. I would personally remove any client apps from the mamp server. They error you are receiving seems related to MDX which this starter doesn't use.

kilinkis commented 4 years ago

I just had the same issue @iaremarkus, and deleted the docs directory and then it worked :) it's a weird bug but that's the workaround