zgordon / tabor-gatsby-theme

A port of the Tabor WordPress Theme over to Gatsby
77 stars 23 forks source link

Dependencies and requirements #17

Open yumyo opened 4 years ago

yumyo commented 4 years ago

Very nice project and it works against the demo site. However it's otherwise quite hard to setup without knowing which versions of WPGraphQL is required and if there are any constraint in terms of data (beyond what any WP install brings in)

Currently my build fails as follows:

success onPreBootstrap — 0.010 s
error Plugin gatsby-source-graphql returned an error

  GraphQLError: Syntax Error: Expected Name, found }

  - gatsby-node.js:82 Object.<anonymous>
    [g-tabor]/[gatsby-source-graphql]/gatsby-node.js:82:31

  - Generator.next

warning The gatsby-source-graphql plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes — 0.108 s
success building schema — 0.102 s
error Plugin gatsby-theme-tabor returned an error

  TypeError: Cannot destructure property `wpgraphql` of 'undefined' or 'null'.

  - createPosts.js:112 graphql.then
    *****/g-tabor/packages/gatsby-theme-tabor/create/createPosts.    js:112:11

  - util.js:16 tryCatcher
    [g-tabor]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [g-tabor]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [g-tabor]/[bluebird]/js/release/promise.js:569:18

  - promise.js:606 Promise._settlePromiseCtx
    [g-tabor]/[bluebird]/js/release/promise.js:606:10

  - async.js:142 _drainQueueStep
    [g-tabor]/[bluebird]/js/release/async.js:142:12

  - async.js:131 _drainQueue
    [g-tabor]/[bluebird]/js/release/async.js:131:9

  - async.js:147 Async._drainQueues
    [g-tabor]/[bluebird]/js/release/async.js:147:5

  - async.js:17 Immediate.Async.drainQueues
    [g-tabor]/[bluebird]/js/release/async.js:17:14

success createPages — 0.134 s
success createPagesStatefully — 0.033 s
success onPreExtractQueries — 0.000 s
success update schema — 0.123 s
error GraphQL Error Unknown type "WPGraphQL_MenuItem".

  file: *****/packages/gatsby-theme-tabor/src/components/Menu.js

   1 |
>  2 |   fragment MenuFields on WPGraphQL_MenuItem {
     |                          ^
   3 |     id
   4 |     label
   5 |     url
   6 |     connectedObject {
   7 |       __typename
   8 |     }
   9 |   }
  10 |
  11 |   query GET_MENU_ITEMS {
  12 |     wpgraphql {

success extract queries from components — 0.098 s
yumyo commented 4 years ago

Partial Update:

However, when it comes to my install and even using WPGraphQL 0.2.3 and Tabor's demo content, my build still fails with he same error above. It seems the issue is related to same missing/incorrectly named data beyond the Menu location name. Sadly, the error does not help much ...

Partial Update(2): The build works against wpgraphql demo site as well https://demo.wpgraphql.com/ so it is "just" a site specific issue but can't figure out which field or other data is missing ... My test url is http://dev-k-blocks.pantheonsite.io/graphql

Update(3): Just used another of the WP sites I manage and it works ... :( ... so the hard question remains ... how to find what data is missing? Is there any way in Gatsby to do that?