New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLError: Cannot query field "allWordpressPage" on type "RootQueryType". #3291

Closed
nathanlampe opened this Issue Dec 20, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@nathanlampe

nathanlampe commented Dec 20, 2017

Changing the domain for using-wordpress example breaks when running gatsby build and I get GraphQLError: Cannot query field "allWordpressPage" on type "RootQueryType"..
http://blinkvr.com/wp-json/wp/v2/posts/

nathan.lampe /private/var/www/html/gatsby/examples/using-wordpress (master) (∩`-´)⊃━☆゚gatsby build
success delete html files from previous builds — 0.019 s
success open and validate gatsby-config.js — 0.018 s
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's not any stale
data
success copy gatsby files — 0.023 s
success onPreBootstrap — 0.008 s
⡀ source and transform nodes -> wordpress__akismet_v1 fetched : 1
⢀ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠠ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠐ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠈ source and transform nodes -> wordpress__yoast_v1 fetched : 1
⠁ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠂ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠄ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⡀ source and transform nodesThe server response was "403 Forbidden"
Inner exception message : "Sorry, you are not allowed to do that."
⠁ source and transform nodesThe server response was "502 Bad Gateway"
⠂ source and transform nodes -> wordpress__acf_pages fetched : 5
⢀ source and transform nodes -> wordpress__acf_media fetched : 100
⠐ source and transform nodes -> wordpress__acf_categories fetched : 5
⠈ source and transform nodes -> wordpress__acf_tags fetched : 0
⡀ source and transform nodes -> wordpress__acf_comments fetched : 29
⢀ source and transform nodes -> wordpress__acf_users fetched : 1
error Plugin gatsby-source-wordpress returned an error


  Error: read ECONNRESET

warning The gatsby-source-wordpress plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes — 175.666 s
success building schema — 0.131 s
success createLayouts — 0.033 s
⠁ [ { GraphQLError: Cannot query field "allWordpressPage" on type "RootQueryType". Did you mean "allSitePage"?
      at Object.Field (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:65:31)
      at Object.enter (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/language/visitor.js:295:29)
      at Object.enter (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/language/visitor.js:337:25)
      at visit (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/language/visitor.js:227:26)
      at visitUsingRules (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/validation/validate.js:75:22)
      at validate (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/validation/validate.js:60:10)
      at /private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/graphql.js:69:51
      at Promise._execute (/usr/local/lib/node_modules/gatsby-cli/node_modules/bluebird/js/release/debuggability.js:303:9)
      at Promise._resolveFromExecutor (/usr/local/lib/node_modules/gatsby-cli/node_modules/bluebird/js/release/promise.js:483:18)
      at new Promise (/usr/local/lib/node_modules/gatsby-cli/node_modules/bluebird/js/release/promise.js:79:10)
      at graphqlImpl (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/graphql.js:59:10)
      at graphql (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/graphql/graphql.js:48:227)
      at graphqlRunner (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/gatsby/dist/bootstrap/index.js:368:22)
      at Promise (/private/var/www/html/gatsby/examples/using-wordpress/gatsby-node.js:21:5)
      at Promise._execute (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/bluebird/js/release/debuggability.js:303:9)
      at Promise._resolveFromExecutor (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/bluebird/js/release/promise.js:483:18)
      at new Promise (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/bluebird/js/release/promise.js:79:10)
      at Object.exports.createPages (/private/var/www/html/gatsby/examples/using-wordpress/gatsby-node.js:14:10)
      at runAPI (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/gatsby/dist/utils/api-runner-node.js:104:36)
      at /private/var/www/html/gatsby/examples/using-wordpress/node_modules/gatsby/dist/utils/api-runner-node.js:178:33
      at /private/var/www/html/gatsby/examples/using-wordpress/node_modules/async/internal/map.js:27:9
      at replenish (/private/var/www/html/gatsby/examples/using-wordpress/node_modules/async/internal/eachOfLimit.js:64:17)
    message: 'Cannot query field "allWordpressPage" on type "RootQueryType". Did you mean "allSitePage"?',
    locations: [ [Object] ],
    path: undefined } ]
error Plugin default-site-plugin returned an error


  Error: 

success createPages — 0.023 s
error Cannot read property 'allWordpressPage' of undefined


  TypeError: Cannot read property 'allWordpressPage' of undefined
  
  - gatsby-node.js:48 graphql.then.result
    /private/var/www/html/gatsby/examples/using-wordpress/gatsby-node.js:48:27
  
  - util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:606 Promise._settlePromiseCtx
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:606:10
  
  - async.js:138 Async._drainQueue
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12
  
  - async.js:143 Async._drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:143:10
  
  - async.js:17 Immediate.Async.drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14
  

error UNHANDLED REJECTION


  TypeError: Cannot read property 'allWordpressPage' of undefined
  
  - gatsby-node.js:48 graphql.then.result
    /private/var/www/html/gatsby/examples/using-wordpress/gatsby-node.js:48:27
  
  - util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:606 Promise._settlePromiseCtx
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:606:10
  
  - async.js:138 Async._drainQueue
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12
  
  - async.js:143 Async._drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:143:10
  
  - async.js:17 Immediate.Async.drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14
@nathanlampe

This comment has been minimized.

Show comment
Hide comment
@nathanlampe

nathanlampe Dec 20, 2017

gatsby-config.js

module.exports = {
  siteMetadata: {
    title: `A sample site using gatsby-source-wordpress`,
    subtitle: `Data fetched from a site hosted on wordpress.com`,
  },
  plugins: [
    // https://public-api.wordpress.com/wp/v2/sites/gatsbyjsexamplewordpress.wordpress.com/pages/
    /*
     * Gatsby's data processing layer begins with “source”
     * plugins. Here the site sources its data from Wordpress.
     */
    {
      resolve: `gatsby-source-wordpress`,
      options: {
        /*
        * The base URL of the Wordpress site without the trailingslash and the protocol. This is required.
        * Example : 'gatsbyjswpexample.wordpress.com' or 'www.example-site.com'
        */
        baseUrl: `blinkvr.com`,
        // The protocol. This can be http or https.
        protocol: `http`,
        // Indicates whether the site is hosted on wordpress.com.
        // If false, then the asumption is made that the site is self hosted.
        // If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
        // If your site is hosted on wordpress.org, then set this to false.
        hostingWPCOM: false,
        // If useACF is true, then the source plugin will try to import the Wordpress ACF Plugin contents.
        // This feature is untested for sites hosted on Wordpress.com
        useACF: true,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    `gatsby-plugin-glamor`,
    {
      resolve: `gatsby-plugin-typography`,
      options: {
        pathToConfigModule: `src/utils/typography.js`,
      },
    },
  ],
}

nathanlampe commented Dec 20, 2017

gatsby-config.js

module.exports = {
  siteMetadata: {
    title: `A sample site using gatsby-source-wordpress`,
    subtitle: `Data fetched from a site hosted on wordpress.com`,
  },
  plugins: [
    // https://public-api.wordpress.com/wp/v2/sites/gatsbyjsexamplewordpress.wordpress.com/pages/
    /*
     * Gatsby's data processing layer begins with “source”
     * plugins. Here the site sources its data from Wordpress.
     */
    {
      resolve: `gatsby-source-wordpress`,
      options: {
        /*
        * The base URL of the Wordpress site without the trailingslash and the protocol. This is required.
        * Example : 'gatsbyjswpexample.wordpress.com' or 'www.example-site.com'
        */
        baseUrl: `blinkvr.com`,
        // The protocol. This can be http or https.
        protocol: `http`,
        // Indicates whether the site is hosted on wordpress.com.
        // If false, then the asumption is made that the site is self hosted.
        // If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
        // If your site is hosted on wordpress.org, then set this to false.
        hostingWPCOM: false,
        // If useACF is true, then the source plugin will try to import the Wordpress ACF Plugin contents.
        // This feature is untested for sites hosted on Wordpress.com
        useACF: true,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    `gatsby-plugin-glamor`,
    {
      resolve: `gatsby-plugin-typography`,
      options: {
        pathToConfigModule: `src/utils/typography.js`,
      },
    },
  ],
}
@KyleAMathews

This comment has been minimized.

Show comment
Hide comment
@KyleAMathews

KyleAMathews Dec 20, 2017

Contributor

Queries in code are tied to the data you're pulling in via the source plugin. If you want to change to a different wordpress source then queries might fail if the new source doesn't have similar data to the previous source. You should remove the existing pages and start building up from scratch for your new site.

Contributor

KyleAMathews commented Dec 20, 2017

Queries in code are tied to the data you're pulling in via the source plugin. If you want to change to a different wordpress source then queries might fail if the new source doesn't have similar data to the previous source. You should remove the existing pages and start building up from scratch for your new site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment