Git Product home page Git Product logo

gatsby-source-wordpress-experimental's Introduction

Wapuu hugging a ball with the Gatsby logo on it

Gatsby and gatsby-source-wordpress-experimental are released under the MIT license. Current npm package version. Downloads per month on npm. Total downloads on npm. PRs welcome! Follow @gatsbyjs

This package is now published as gatsby-source-wordpress

This page has moved to the Gatsby monorepo!

Hi there! ๐Ÿ‘‹ thank you so much for being a beta/alpha tester of this plugin! You've helped us bring a much more stable WordPress integration to Gatsby and we're very thankful for that!

We've shipped this plugin as [email protected]. gatsby-source-wordpress-experimental is now deprecated. Please upgrade by npm/yarn installing the latest version of the stable plugin and updating your gatsby-config.js to include the stable plugin name.

We've chosen this point to release this plugin as a stable release not because there are no bugs (all software has some bugs), but because this plugin is far more stable than the last major version of gatsby-source-wordpress.

Note that we will continue fixing Github issues you've opened in the -experimental repo - those are not forgotten and will be transferred to the Gatsby monorepo.

Thank you! ๐Ÿ’œ

Overview ๐ŸŒž

This plugin works by merging the WPGraphQL schema & data with the Gatsby schema & Node model which allows us to efficiently cache WP data in Gatsby. What this means is that incremental builds, fast builds, and CMS Previews work beautifully! ๐Ÿ’…

Developer & Content Creator experience are some of our main focuses with this integration. Please send us your feedback!

โš™๏ธ๐Ÿ”Ž๐Ÿ‘€๐Ÿ‘‰๐Ÿ“

Docs ๐Ÿ“–

Relevant Links ๐Ÿ”—

gatsby-source-wordpress-experimental's People

Contributors

acao avatar adrianluk avatar cbou avatar dependabot[bot] avatar gillkyle avatar imranhsayed avatar jacobarriola avatar jasonbahl avatar kawamataryo avatar moonmeister avatar mor10 avatar p0intbl4nc avatar petercr avatar rburgst avatar rburgstaller avatar robmarshall avatar shosasaki0 avatar stupearce avatar trevorblades avatar tylerbarnes avatar vscncls avatar zeevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-source-wordpress-experimental's Issues

Images with Greek characters in title failing on build

Terminal says "Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD" but even lowering doesn't help. It seems it only does this if the media has a title written in Greek.

11:35:37 AM: success Downloading remote files - 3.577s - 62/62 17.34/s 11:36:51 AM: info pushing https://example.com/wp-content/uploads/2014/11/ฮฑฯฯ„ฮต.jpg to the end of the request queue. 11:36:51 AM: info Previously retried 2 times already. 11:37:16 AM: info pushing https://example.com/wp-content/uploads/2014/11/ฮฑฯฯ„ฮต.jpg to the end of the request queue. 11:37:16 AM: info Previously retried 3 times already. 11:37:41 AM: info pushing https://example.com/wp-content/uploads/2014/11/ฮฑฯฯ„ฮต.jpg to the end of the request queue. 11:37:41 AM: info Previously retried 4 times already. 11:38:10 AM: info 11:38:10 AM: already re-queued https://example.com/wp-content/uploads/2014/11/ฮฑฯฯ„ฮต.jpg 5 times :( sorry. 11:38:10 AM: Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD. 11:38:10 AM: It's currently set to 200 11:38:10 AM: error wrong url: https://example.com/wp-content/uploads/2014/11/ฮฑฯฯ„ฮต.jpg 11:38:10 AM: not finished source and transform nodes - 260.167s 11:38:10 AM: not finished gatsby-source-wordpress fetching nodes - 260.088s - 1957 total 11:38:10 AM: not finished gatsby-source-wordpress creating nodes - 244.392s - awaiting async side effects - 8 additional nodes fetched 11:38:10 AM: not finished gatsby-source-wordpress MediaItem - 244.391s - fetched 523 11:38:10 AM: not finished Generating image thumbnails - 242.943s 11:38:11 AM: Skipping functions preparation step: no functions directory set 11:38:21 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1

Modify delta queries to use node list queries so that node filters apply

Currently when using the Type.nodeFilters option, that will only be applied to lists of nodes as they're sourced, not when nodes are incrementally updated. This is important for multilingual sites that live across multiple domains and require multiple gatsby builds (1 for each domain) that are filtered to each language. The problem is that node filters don't apply to single node queries. They could though if those single node queries were just node list queries limited to 1 node in a specific id. That way if an action is picked up by Gatsby from WP to pull a node in but that node was filtered out, the single node node-list query would simply return null.

GIF's in inline html not supported

Hey @TylerBarnes !

I'm upgrading from 0.1.8 -> 0.7.11 and am running into the following issue when running gatsby develop.

Other relative info:

  • wp-graphql: 0.9.1
  • wp-graphql-gutenberg: 0.3.4
  • wp-gatsby: 0.4.1
  • gatsby-plugin-sharp: 2.6.9
  • gatsby: 2.22.11

The build works as expected when I set html: { useGatsbyImage: false } in my gatsby-config.js file.

How do I troubleshoot this?

Thanks!

...
success Downloading remote files - 26.968s - 7/7 0.26/s
success Downloading remote files - 40.323s - 9/9 0.22/s
success Downloading remote files - 73.046s - 15/15 0.21/s
success Downloading remote files - 47.556s - 12/12 0.25/s

 ERROR 

Expected positive integer for height but received NaN of type number



  Error: Expected positive integer for height but received NaN of type numbe  r
  
  - is.js:101 Object.invalidParameterError
    [***]/[sharp]/lib/is.js:101:10
  
  - resize.js:242 Sharp.resize
    [***]/[sharp]/lib/resize.js:242:18
  
  - index.js:321 generateBase64
    [***]/[gatsby-plugin-sharp]/index.js:321:12
  
  - index.js:388 cachifiedProcess
    [***]/[gatsby-plugin-sharp]/index.js:388:24
  
  - runMicrotasks
  
  - task_queues.js:62 runNextTicks
    internal/process/task_queues.js:62:5
  
  - timers.js:429 processImmediate
    internal/timers.js:429:9
  
  - index.js:396 async base64
    [***]/[gatsby-plugin-sharp]/index.js:396:12
  
  - index.js:581 async fluid
    [***]/[gatsby-plugin-sharp]/index.js:581:19
  
  - process-node.js:343 
    [***]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/process-node.js:343:23
  
  - async Promise.all
  
  - process-node.js:287 async replaceNodeHtmlImages
    [***]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/process-node.js:287:41
  
  - process-node.js:458 async processNodeString
    [***]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/process-node.js:458:18
  
  - process-node.js:494 async processNode
    [***]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/process-node.js:494:31
  
  - create-nodes.js:49 
    [***]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/create-nodes.js:49:12
  
  - index.js:256 async run
    [***]/[p-queue]/dist/index.js:256:29
  

warn  gatsby-source-wordpress  Page cG9zdDo5 couldn't process inline html
success  gatsby-source-wordpress  MediaItem - 1557.643s - fetched 364
success  gatsby-source-wordpress  creating nodes - 1557.663s - awaiting
success  gatsby-source-wordpress  fetching nodes - 1615.135s - 648 total
success Downloading remote files - 32.527s - 9/9 0.28/s

 ERROR 

Processing /Users/jacob/Documents/Projects/***/.cache/caches/gatsby-source-wordpress-experimental/b4fd999e1e44389818ff403b27c3c63c/lazy-placeholder.gif failed

Original error:
width has to be a positive int larger than zero (> 0), now it's 0



  WorkerError: Processing /Users/jacob/Documents/Projects/***/.cache/caches/gatsby-source-wordpress-experimental/b4fd999e1e44389818ff  403b27c3c63c/lazy-placeholder.gif failed
  Original error:
  width has to be a positive int larger than zero (> 0), now it's 0
  
  - jobs-manager.js:316 exports.enqueueJob
    [***]/[gatsby]/dist/utils/jobs-manager.js:316:23
  

not finished source and transform nodes - 1616.505s
not finished Generating image thumbnails - 1340.519s
not finished  gatsby-source-wordpress  fetch root fields - 1.316s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ***@1.0.0 develop: `NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ***@1.0.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jacob/.npm/_logs/2020-06-24T18_25_15_986Z-debug.log

Filtering ACF options page by language

Hi,

Current Problem
I'm using ACF and Polylang to handle my options pages. I've managed to get the GraphQL query work in WP, to get the options by language, using a filter:

query GET_HEADER_AND_FOOTER {
  themeSettings(language: EN) {
    acfHeaderAndFooter {
      cookiesLinkLabel
      copyright
      websiteCreator
    }
  }
}

but the schema in Gatsby is different, and I cannot filter by language or get a list of all the nodes for each language. I can only write this query, which will return only the default language node:

query GET_HEADER_AND_FOOTER {
  allWp {
    nodes {
      themeSettings {
        acfHeaderAndFooter {
          copyright
          websiteCreator
          cookiesLinkLabel
        }
      }
    }
  }
}

Possible solution
It would be great to be able to do something along the lines of

query GET_HEADER_AND_FOOTER {
  allWp {
    nodes {
      themeSettings(filter: { language: { eq: "EN" } } {
        acfHeaderAndFooter {
          copyright
          websiteCreator
          cookiesLinkLabel
        }
      }
    }
  }
}

or having the query returns nodes for every language with a language field, so I can filter in my code.

It is not a blocking issue, as I can just give up using Options and create a custom type for handling these settings. But the UI would be easier to understand for a content editor.

Thank you for all the work on this plugin!

Regards,
Pierre

Preview with draft and private post

I have managed to get preview to work for published post, but not for draft and private post and getting 404 page as a result. Does preview work with these post status or only for published post?

I setup TylerBarnes's using-gatsby-source-wordpress-experimental starter and also converted gatsby-starter-wordpress with gatsby-source-wordpress-experimental, tested locally through ngrok and through Gatsby Cloud.

There is no mention of it in the preview's page nor Gatsby Cloud newest WordPress getting started page.

Running:

  • WP Gatsby 0.4.8
  • WP GraphQL 0.10.2
  • WP 5.4.2
  • gatsby-source-wordpress-experimental 1.0.2
  • Preview through Gatsby Cloud and further test locally through ngrok

Setting "Image size" in "Elementor" to a size smaller than the original triggers 401 (Restricted)!

Hello @TylerBarnes , Thanks for offering to look into this, I finally found the root cause !Horray?!

I had this error in a production site, so I created a demo site to test it.

To replicate exactly what I did, or you can skip to step (11):

  1. create a flywheel demo site (14 days trial)
  2. Enable pretty permalink to avoid this issue later
  3. Install your own starter :)
  4. Install WP Gatsby Version 0.4.8 and WP GraphQL Version 0.10.2 and Elementor Version 2.9.13
  5. Add the flywheel demo site's grqphql URL and htacess in the config.js (The demo site is private, which is good as my client's WP instance is too)
      options: {
        url:
          process.env.WPGRAPHQL_URL ||
          `https://dev-gatsby-source-wordpress-v4.pantheonsite.io/graphql`,
        verbose: true,
        develop: {
          hardCacheMediaFiles: true,
        },
        debug: {
          graphql: {
            writeQueriesToDisk: true,
          },
        },
        auth: {
          htaccess: {
            username: process.env.HTTPBASICAUTH_USERNAME,
            password: process.env.HTTPBASICAUTH_PASSWORD,
          },
        },
...
  1. Run yarn then yarn clean-develop, it will work fine!
  2. Add a small image (1) to any of your posts, doesn't even need to be published, as long as it is in your media, and run yarn clean-develop again and you will get this error:
failed to process http://gatsby-wp-demo.flywheelsites.com/wp-content/uploads/2020/07/single-stroke-ar-nazeh-5.png
HTTPError: Response code 401 (Restricted)

Images will be attached below for replicating the test precisely
7. To solve this issue, you need to upgrade the plugin beyond 0.8.3 to solve this issue

// package.json
    "gatsby-source-wordpress-experimental": "^1.0.0",
  1. Now run yarn and yarn clean-develop and it should work fine even if the image is published in a post.
  2. Now upload a huge image (2), well look at that still works!

Here comes Elementor

  1. Now let's try Elementor! Add Image(1) which has dimensions of (831 x 973 pixels) by default image size is (Large 1024 x 1024)
    brave_el5jIpJCsg
    update and Gatsby will crash with:
 gatsby-source-wordpress  failed to process http://gatsby-wp-demo.flywheelsites.com/wp-content/uploads/2020/07/single-stroke-ar-nazeh-5.png
HTTPError: Response code 401 (Restricted)

However, If you change the "Image size" in Elementor to a little higher (1536 x 1536) it will work fine!

The same goes for image(2) , Add it to the post with the default size (1024 x 1024), gatsby will crash! change it to (full) and run again and every thing works fine!!

Conclusion

I have no idea :D

(1)
single-stroke-ar-nazeh (5)

(2)
rachel-lynette-french-U7HLzMO4SIY-unsplash

Querying url on generalSettings crashes WP multisite

I'm working on a WP multisite and want to migrate from gatsby-source-graphql.
However, I get this error on dev build.

 gatsby-source-wordpress  GraphQL query: {
       schemaMd5
       # also get the wpUrl to save on # of requests
       # @todo maybe there's a better place for this
      generalSettings {
            url
         }
      }

The core problem lies with WPGraphQL which doesn't generate any url node on generalSettings for WP multisite. See wp-graphql/wp-graphql#1334
The build breaks since this plugin seems to query the url on generalSettings when looking for changes in diff-schemas.js.

As mentioned, this is primarily a WPGraphQL bug, but it would be great with a fix that allows for the query to fail. This in order not to be blocked from using this plugin until there is a fix from WPGraphQL.

Cannot query field "connectedObject" on type "WpMenuItem"

The error below is when using a fresh site with the start using gatsby new krux-gatsby https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/ (also tried directly from Tyler's repo and had the same issue). I'm using WordPress 5.4.2, and PHP 7.4, ensured that the environment variable was set (and also updated manually within the gatsby-config.php), and have both versions of the plugin installed.

This is a headless WordPress installation at krux.wpengine.com, so not sure if that could be interfering, but I wouldn't think so, since the graphql endpoints on the site respond as expected, eg https://krux.wpengine.com/graphql?query={pages{edges{node{id}}}}. I also tested disabling the headless mode and the issue seems to persist after removing my .cache folder in the Gatsby project and restarting the develop server.

For what it's worth, I also tried the suggestion in the error to no avail. Any insight would be greatly appreciated! I didn't see any other issues submitted with this particular error, so I assume that I am doing something incorrectly. ๐Ÿ˜„

  16:13  error  Cannot query field "connectedObject" on type "WpMenuItem". Did you mean "connectedNode"?  graphql/template-strings

โœ– 1 problem (1 error, 0 warnings)


File: src/components/menu.js

failed Re-building development bundle - 0.204s

Here is the debug info for my machine as well

  System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
    npm: 6.14.6 - ~/.nvm/versions/node/v10.16.0/bin/npm
  Languages:
    Python: 3.7.4 - /Users/brett.krueger/miniconda3/bin/python
  Browsers:
    Chrome: 83.0.4103.116
    Firefox: 77.0.1
    Safari: 13.1.1
  npmPackages:
    gatsby: 2.22.5 => 2.22.5
    gatsby-image: ^2.4.5 => 2.4.13
    gatsby-plugin-chakra-ui: ^0.1.4 => 0.1.4
    gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
    gatsby-plugin-sharp: ^2.6.8 => 2.6.19
    gatsby-source-filesystem: ^2.3.7 => 2.3.19
    gatsby-source-wordpress-experimental: 0.8.0 => 0.8.0
    gatsby-transformer-sharp: 2.5.3 => 2.5.3
    gatsby-wordpress-experimental-inline-images: ^0.0.3 => 0.0.3
  npmGlobalPackages:
    gatsby-cli: 2.12.60

Fetching images at build time causes an error

Hi

I'm about to try out a great plugin, but when I push the first image, it says An error has occurred and I am unable to proceed.

The error is this.

already re-queued /wp-content/uploads/2020/06/test.jpg 5 times :( sorry.
Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD.
It's currently set to undefined

It's not just this image that is showing an error.

The image exists and it can be seen when I hit the URL.
The images are all over 1MB in size, is there a reason for this?
Changing GATSBY_CONCURRENT_DOWNLOAD did not solve the problem It was.

It probably stops here.

source and transform nodes
gatsby-source-wordpress  fetching nodes โ€” 258 total
gatsby-source-wordpress  creating nodes
gatsby-source-wordpress  MediaItem โ€” fetched 200

Thank you for all the work on this plugin!

Regards,
sasaki

403 error fetching nodes

Hi, I have been running on the same issue all day and can't seem to progress much. None of the nodes queries are working (output below only mentions the Comment type, but I get errors for Pages, Users etc).

 gatsby-source-wordpress  Request failed with status code 403

Error occured while fetching nodes of the "Comment" type.

GraphQL request to https://wordsinspace.net/shannon/graphql failed.

Please ensure the following statements are true
  - your WordPress URL is correct in gatsby-config.js
  - your server is responding to requests
  - WPGraphQL and WPGatsby are installed in your WordPress backend

not finished source and transform nodes - 1.032s
not finished  gatsby-source-wordpress  fetching nodes - 1.009s
not finished  gatsby-source-wordpress  Category - 1.025s
not finished  gatsby-source-wordpress  Comment - 1.045s
not finished  gatsby-source-wordpress  ContentType - 1.088s
not finished  gatsby-source-wordpress  MenuItem - 1.142s
not finished  gatsby-source-wordpress  Menu - 1.194s
not finished  gatsby-source-wordpress  Page - 1.218s
not finished  gatsby-source-wordpress  Post - 1.225s
not finished  gatsby-source-wordpress  Tag - 1.228s
not finished  gatsby-source-wordpress  Taxonomy - 1.227s
not finished  gatsby-source-wordpress  TermNode - 1.249s
not finished  gatsby-source-wordpress  User - 1.245s

I am using showQueryOnError: true to inspect the query structure, here is the relevant output which results in ERROR:

 gatsby-source-wordpress  GraphQL query: query NODE_LIST_QUERY($first: Int!, $after: String) {
  posts(first: $first, after: $after, where: { parent: null }) {
    nodes {
      author {
        id
      }
      categories(first: 100) {
        nodes {
          id
        }
        pageInfo {
          endCursor
          hasNextPage
          hasPreviousPage
          startCursor
        }
      }
      commentCount
      commentStatus
      comments(first: 100) {
        nodes {
          id
        }
        pageInfo {
          endCursor
          hasNextPage
          hasPreviousPage
          startCursor
        }
      }
      content
      contentType {
        node {
          id
        }
      }
      databaseId
      date
      desiredSlug
      editLast {
        id
      }
      enclosure
      excerpt
      featuredImage {
        id
        sourceUrl
      }
      guid
      id
      isRevision
      link
      modified
      modifiedGmt
      pingStatus
      pinged
      postFormats {
        pageInfo {
          endCursor
          hasNextPage
          hasPreviousPage
          startCursor
        }
      }
      slug
      status
      tags(first: 100) {
        nodes {
          id
        }
        pageInfo {
          endCursor
          hasNextPage
          hasPreviousPage
          startCursor
        }
      }
      template {
        __typename
        ... on DefaultTemplate {
          templateName
        }
        ... on SitemapTemplate {
          templateName
        }
      }
      termNames
      termSlugs
      terms {
        __typename
        ... on Category {
          id
        }
        ... on Tag {
          id
        }
      }
      title
      toPing
      uri
      __typename
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Some of you have mentioned that running this on a subdomain has been a problem (I am effectively trying to run it on a http://domainname.com/user/ Wordpress instance as opposed to http://wordpressname.com), so I followed the advice in these issues without much success.

dont stop processing when image is not found

currently if an image is not found, the processing stops. It would be nice to allow the process to carry on (maybe replace missing images with a bright red default image).

I already tried to patch errorPanicker but it still fails with

already re-queued http://dockerhost:8000/wp-content/uploads/2020/05/missing-image.jpg 5 times :( sorry.
Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD.
It's currently set to 5

Can't query Posts locally after upgrading to 0.8.1 + WPGraphQL v0.10

Hi,
I'm getting a strange behavior after upgrading to WPGraphQL v1.0 and gatsby-source-wordpress-experimental to 0.8.1. Using GraphiQL on my Wordpress IDE all queries run fine, but on http://localhost:8000/___graphql the same query fails to fetch the Posts nodes.

localhost

image

GraphiQL on Wordpress

image

Here is an example error I'm getting in the console:

success Build manifest and related icons - 0.151s
success onPostBootstrap - 0.155s
info bootstrap finished - 21.654s
success run static queries - 0.021s - 4/4 191.70/s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Cannot read property 'id' of null

   1 | query getTag($slug: String!) {
   2 |   allWpTag(filter: {slug: {eq: $slug}}) {
   3 |     nodes {
   4 |       name
   5 |       slug
   6 |       posts {
>  7 |         nodes {
     |         ^
   8 |           title
   9 |           slug
  10 |           date
  11 |           nodeType
  12 |         }
  13 |       }
  14 |       pages {
  15 |         nodes {
  16 |           title
  17 |           slug

File path: /Users/Kallirroi/Documents/code/shannon/exploring/wordpress-tutorial-site/src/templates/tag.js
Url path: /publications
Plugin: none

Versions

gatsby-source-wordpress-experimental: 0.8.1
WP Gatsby: 0.4.8
WP GraphQL: 0.10.2
WP GraphiQL: 1.0.1

Feat: Add error message about pluginOptions.schema.perPage for timeouts

Right now when a request times out the error message mentions increasing the timeout, but another possibility is decreasing the perPage setting to lower the amount of work the remote server needs to do for each request. The error message in src/utils/fetch-graphql.js on line 207 should mention this.

PNG with transparency don't display correctly

Hi,
It seems that the way that gatsby images are managed does not work well with pngs with transparency.
As far as I understand how it works, the "data/image" image is displayed underneath the final image. But in the case of images with transparency the blurred parts are still visible. I attach a screenshot and a link to the demo - (very bottom of the page).
Screenshot 2020-07-02 08 36 17
In the screenshot below I hide the "data/image" with display: none so that you can see how it should be displayed.
Screenshot 2020-07-02 08 40 15

Preview not sending ACF custom fields

I have a local WordPress site with the following plugins installed:

  • Advanced Custom Fields PRO
  • WP Gatsby
  • WP GraphQL
  • WPGraphQL for Advanced Custom Fields

I have a local Gatsby site running with ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop.

The WordPress instance settings are correctly pointing to the local preview server. I can see changes reflected in preview mode for the standard fields, such as the title.

However, the values in the custom fields are not being sent in the preview (they get null values despite having values in WordPress). Outside the preview mode, they work properly though.

Is ACF currently supported in preview mode?

Cannot add the latest package due to allocation failure

While adding/installing the following version, yarn fails due to allocation failure.
Version: "gatsby-source-wordpress-experimental": "^0.7.8".

The last version that worked was 0.6.1 and started failing with 0.7.0.

yarn install v1.22.4
[1/4] Resolving packages...
warning gatsby-source-wordpress-experimental > gatsby > gatsby-cli > gatsby-recipes > graphql-tools > @graphql-tools/relay-operation-optimizer > relay-compiler > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "gatsby > @pmmmwh/[email protected]" has incorrect peer dependency "react-refresh@^0.8.2".
warning "gatsby > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > [email protected]" has incorrect peer dependency "theme-ui@^0.2.0".
warning " > [email protected]" has incorrect peer dependency "gatsby-plugin-sharp@^2.6.8".
warning "gatsby-source-wordpress-experimental > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "gatsby-source-wordpress-experimental > @babel/plugin-proposal-class-properties > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-env > @babel/plugin-proposal-unicode-property-regex > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "gatsby-source-wordpress-experimental > babel-preset-gatsby > @babel/preset-react > @babel/plugin-transform-react-jsx > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "gatsby-source-wordpress-experimental > gatsby > @pmmmwh/[email protected]" has incorrect peer dependency "react-refresh@^0.8.2".
warning "gatsby-source-wordpress-experimental > gatsby > gatsby-admin > [email protected]" has incorrect peer dependency "[email protected]".
warning "gatsby-source-wordpress-experimental > gatsby > gatsby-admin > [email protected]" has incorrect peer dependency "[email protected]".
warning "gatsby-source-wordpress-experimental > gatsby > gatsby-admin > [email protected]" has incorrect peer dependency "yup@^0.27.0".

<--- Last few GCs --->

[19360:0x39a0b00]   235529 ms: Mark-sweep 2037.5 (2056.6) -> 2035.8 (2058.3) MB, 1322.9 / 0.0 ms  (average mu = 0.094, current mu = 0.008) allocation failure scavenge might not succeed
[19360:0x39a0b00]   237130 ms: Mark-sweep 2043.9 (2062.8) -> 2039.0 (2070.3) MB, 1586.6 / 0.0 ms  (average mu = 0.043, current mu = 0.009) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x0827ec7c08d1 <JSObject>
    0: builtin exit frame: concat(this=0x37217e4eb751 <JSArray[9]>,0x097205cd13b9 <String[#9]: react-dom>,0x37217e4eb751 <JSArray[9]>)

    1: getNewParts [0x2475f91f9c9] [/usr/share/yarn/lib/cli.js:~94371] [pc=0x571c133567e](this=0x399708cddc51 <PackageHoister map = 0x2988b9fb5d19>,0x37217e4e9959 <String[337]: gatsby-source-wordpress-experimental#gatsby#gatsby-plugin-page-creator#gatsby#gatsby-...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa09830 node::Abort() [node]
 2: 0xa09c55 node::OnFatalError(char const*, char const*) [node]
 3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd2a1f5  [node]
 6: 0xd2a886 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd37105 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xd37fb5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xd3aa6c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd012a2 v8::internal::Factory::AllocateRawWithAllocationSite(v8::internal::Handle<v8::internal::Map>, v8::internal::AllocationType, v8::internal::Handle<v8::internal::AllocationSite>) [node]
11: 0xd0cab4 v8::internal::Factory::NewJSArrayWithUnverifiedElements(v8::internal::Handle<v8::internal::FixedArrayBase>, v8::internal::ElementsKind, int, v8::internal::AllocationType) [node]
12: 0xd0cef9 v8::internal::Factory::NewJSArray(v8::internal::ElementsKind, int, int, v8::internal::ArrayStorageAllocationMode, v8::internal::AllocationType) [node]
13: 0xbf4b05  [node]
14: 0xbf51d8 v8::internal::Builtin_ArrayConcat(int, unsigned long*, v8::internal::Isolate*) [node]
15: 0x13c5c79  [node]
Aborted (core dumped)

Feat: namespace redux store by typePrefix option

Right now if multiple instances of the source plugin are used within a single Gatsby site each instance will overwrite the redux store of the other (there's only 1 store). This should remain as 1 store so we can communicate between plugin instances, but state and actions should be scoped by typePrefix.

WP Menu pulls in full URL for menu items in production

Hi! Awesome work on this plugin!

I'm running into an issue where when I try querying the allWpMenu and it returns a full absolute url (ex. https://sitename.com/page-1) instead of a relative one (ex. /page-1). I was wondering if there was any string replacement function that could run during build time, like gatsby-source-wordpress has:

// Search and Replace Urls across WordPress content.
        searchAndReplaceContentUrls: {
          sourceUrl: "https://source-url.com",
          replacementUrl: "https://replacement-url.com",
        }

This only seems to happen when I use WP on our staging server, and not when I'm running it locally.

I've added in a little .replace() function to help, but it doesn't seem like the cleanest solution.

Thanks!

Custom posts types aren't deleted when i switch them from 'publish' to 'trash'

Hello !
Today i encountered a serious problem mostly due to gatsby cache.
I've created a custom post type in my wordpress, everything it's working fine until i delete a entry and send it to the wp 'trash'.
After re-running yarn dev (also occuring after pushing on netlify for example) my entry is still visible in the front. (despite that this entry is in the trash in the wordpress). I tried to filter my custom post type by status: {eq: "publish"} but it doesn't work as well.
My only way to correct this is to delete gatsby cache (yarn clean) and refetch all nodes from wp.
So it's really annoying for a CI/CD with netlify.
Do you have any clues on this ? thx

fetching nodes times out on large files

Hello @TylerBarnes! I'm trying to use this new source plugin (looks amazing!) - but it seems to hang on video media files. I'm not sure if it's my server, but is there a way I can ignore them since they won't be processed by gatsby like the images are?

deployment error after following the 'building a new site' guide

I followed https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/blob/master/docs/tutorials/building-a-new-site-wordpress-and-gatsby.md resulting in a Gatsby app which runs and builds fine locally, however it fails to deploy (I tried both Vercel and Netlify) with the following error:

An unexpected error occurred: "could not find a copy of gatsby to link in /vercel/579b6faa/node_modules/gatsby-source-wordpress-experimental/node_modules".
Error: Command "yarn install" exited with 1

Any tips?

Build failed while fetching nodes

Hi Tyler,

I am getting this error on build in both Gatbsy Cloud and Netlify, however local works fine.

image

I have noticed that this happens if I put a limit greater than 100 posts.

I am using WP Engine and I think this happened after some of the latest updates, I am using version 0.7.1

Do you have any idea where I can search?

Thank you

Document why we wont: Extend Auth options

It would be great to have auth options to retrieve data on behalf of a specific user such as Admin, to see and have access to all possible information. In gatsby WordPress, I can use my user credentials for authorization, so it would be great to have it in this plugin too.

It will also solve this issue:
#41

Documentation: "Installation & Getting Started" doesn't mention that gatsby-node.js assume permalink format

4- In the gatsby-config.js of the starter you just set up, update the plugin options for gatsby-source-wordpress-experimental.
change the url option so that it points to your WordPress instance GraphQL url. This should be the full url of your GraphQL endpoint. Eg https://yoursite.com/graphql
5- Run gatsby develop and experience the magic ๐ŸŒŸ

I created a new Wordpress site using Local from flywheel, and while everything works fine, but createPages() assume that permalinks are formatted in %year%/%month%/%day%/%post-name%/ format.

Missing products on product categories

Hi!
Firstly great work on the plugin. Initial testing with standard wordpress integration has been awesome. Can't thank you enough for tackling this.

Thought I'd try it out with WpGraphql Woocommerce. I'm aware this hasn't been tested yet so feel free to ignore this issue. However since I got this far thought I may as well raise it in case it's useful.

In woocommerce there's allWpProductCategory which has products, which you'd expect to query like this:

{
  allWpProductCategory {
    nodes {
      products {
        nodes {
          name
        }
      }
    }
  }
}

However the products returned are all null, so immediately throw a "Cannot read property 'type' of undefined" error.

Eg if there's 4 products in a category the response will be:

"products": {
  "nodes": [
    null,
    null,
    null,
    null
  ]
}

When I run this query in playground it returns data as expected:

{
  productCategories {
    nodes {
      products {
        nodes {
          name
        }
      }
    }
  }
}

I also ran the query in node-list-query.graphql and data was returned fine.

I wonder if it's related to the fact there are different types of products eg WpVariableProduct and WpSimpleProduct.

I'm guessing woocommerce integration isn't the priority right now but I'm happy to help with testing when the time comes.

Non image media (PDF) throws error

When I add a PDF to a page I get the error Cannot read property 'replace' of null when building.
Deleting the PDF from the media library allows the build to complete.

I'm using the version:
"gatsby-source-wordpress-experimental": "^0.7.1",

Full Error:

Cannot read property 'replace' of null

  TypeError: Cannot read property 'replace' of null

  - fetch-referenced-media-items.js:180 stripImageSizesFromUrl
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/fetch-nodes/fetch-referenced-media-items.js:180:31

  - create-remote-media-item-node.js:33 getFileNodeMetaBySourceUrl
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/create-remote-media-item-node.js:33:84

  - create-remote-media-item-node.js:73 getFileNodeByMediaItemNode
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/create-remote-media-item-node.js:73:28

  - create-remote-media-item-node.js:95 createRemoteMediaItemNode
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/create-nodes/create-remote-media-item-node.js:95:30

  - fetch-referenced-media-items.js:140 retryPromise
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/fetch-nodes/fetch-referenced-media-items.js:140:90

  - fetch-referenced-media-items.js:58 queue.add
    [futuraukFrontend]/[gatsby-source-wordpress-experimental]/steps/source-nodes/fetch-nodes/fetch-referenced-media-items.js:58:13

Error "MediaItem" in inline html: Expected a value of type "Int" but received: 3.99

Hi there,

First off thanks for your work on this awesome plugin! I got the starter site working and love to see the auto-rebuilds after WP content changes.

I'm attempting to use gatsby-source-wordpress-experimental on a site that has 300+ MediaItems of types .jpg, .png, .pdf, .docx, .wmv .pptx, .mp4, .bmp.

Details:

Using "gatsby-source-wordpress-experimental": "^0.8.6"

plugin entry in gatsby-config.js (it is largely copy/pasta from the starter site):

    {
      resolve: `gatsby-source-wordpress-experimental`,
      options: {
        html: {
          useGatsbyImage: true,
        },
        url: process.env.GATSBY_GRAPHQL_API_URL,
        protocol: `https`,
        hostingWPCOM: false,
        // Flip on for debugging
        verboseOutput: true,
        normalizer: ({ entities }) =>
          entities.map(entity => transformSlug(entity)),
        verbose: true,
        schema: {
          queryDepth: 5,
          typePrefix: `Wp`,
          timeout: 30000,
          perPage: 10,
        },
        develop: {
          nodeUpdateInterval: 10000,
          hardCacheMediaFiles: false,
        },
        production: {
          hardCacheMediaFiles: false,
        },
        debug: {
          // these settings are all the defaults,
          // remove them if you'd like
          graphql: {
            showQueryOnError: false,
            showQueryVarsOnError: true,
            copyQueryOnError: true,
            panicOnError: true,
            // a critical error is a WPGraphQL query that returns an error and no response data. Currently WPGQL will error if we try to access private posts so if this is false it returns a lot of irrelevant errors.
            onlyReportCriticalErrors: false,
          },
        },
        // fields can be excluded globally.
        // this example is for wp-graphql-gutenberg.
        // since we can get block data on the `block` field
        // we don't need these fields
        excludeFieldNames: [`blocksJSON`, `saveContent`],
        type: {
          Post: {
            limit:
              process.env.NODE_ENV === `development`
                ? // Lets just pull 50 posts in development to make it easy on ourselves.
                  10
                : // and we don't actually need more than 5000 in production for this particular site
                  5000,
          },
          // this shows how to exclude entire types from the schema
          // these examples are for wp-graphql-gutenberg
          CoreParagraphBlockAttributes: {
            exclude: true,
          },
          CoreParagraphBlockAttributesV2: {
            exclude: true,
          },
          CorePullquoteBlockAttributes: {
            exclude: true,
          },
          MenuItem: {
            exclude: true,
          },
        },
      },
    },

Attempting to run gatsby develop yields following output:

evannichols:_dev/lead-to-read โ€นwp-experimental*โ€บ$ gad
success open and validate gatsby-configs - 0.105s
success load plugins - 1.432s
success onPreInit - 0.012s
success initialize cache - 0.047s
success copy gatsby files - 0.102s
success onPreBootstrap - 0.021s
โ €
info  gatsby-source-wordpress

	This is either your first build or the cache was cleared.
	Please wait while your WordPress data is synced to your Gatsby cache.

	Maybe now's a good time to get up and stretch? :D

success  gatsby-source-wordpress  ingest WPGraphQL schema - 1.850s
success createSchemaCustomization - 3.438s
success  gatsby-source-wordpress  ContentType - 2.256s - fetched 3
success  gatsby-source-wordpress  Category - 4.185s - fetched 13
success  gatsby-source-wordpress  Comment - 4.516s - fetched 21
success  gatsby-source-wordpress  Menu - 1.837s - fetched 1
success  gatsby-source-wordpress  Page - 8.180s - fetched 31
success  gatsby-source-wordpress  Taxonomy - 2.235s - fetched 3
success  gatsby-source-wordpress  Post - 3.072s - fetched 10
success  gatsby-source-wordpress  Tag - 9.204s - fetched 54
success  gatsby-source-wordpress  User - 1.214s - fetched 4

 ERROR

 gatsby-source-wordpress  Error category: undefined

Error:
  Internal server error

 Debug message:
  Expected a value of type "Int" but received: 3.99


 ERROR

 gatsby-source-wordpress  Error category: undefined

Error:
  Internal server error

 Debug message:
  Expected a value of type "Int" but received: 3.99

... about 10 more error messages of same format as above.

Another message reads: Expected a value of type "Int" but received: 4.25. And also 4.13, 4.3, 3.51.

I can share the link to graphql URL privately if needed (and link to repo). I was unable to reproduce using a local WP instance with same file types uploaded. This issue is present regardless of the value of useGatsbyImage in the plugin config.

Further details:

MacBook Pro (Retina, 13-inch, Early 2015)
Node v12.10.0
gatsby-cli -v 2.12.58

Full dump of package.json deps:

  "dependencies": {
    "@apollo/react-hooks": "^3.1.5",
    "apollo-cache-inmemory": "^1.6.5",
    "apollo-client": "^2.6.8",
    "apollo-link-http": "^1.5.17",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.26.0",
    "babel-runtime": "^6.26.0",
    "gatsby": "^2.20.4",
    "gatsby-background-image": "^0.9.12",
    "gatsby-image": "^2.2.34",
    "gatsby-plugin-google-analytics": "^2.3.1",
    "gatsby-plugin-mailchimp": "^5.1.2",
    "gatsby-plugin-manifest": "^2.2.31",
    "gatsby-plugin-offline": "^3.0.27",
    "gatsby-plugin-react-helmet": "^3.1.16",
    "gatsby-plugin-sass": "^2.1.26",
    "gatsby-plugin-sharp": "^2.3.5",
    "gatsby-plugin-typescript": "^2.1.23",
    "gatsby-plugin-typography": "^2.3.20",
    "gatsby-source-filesystem": "^2.1.40",
    "gatsby-source-graphql": "^2.5.0",
    "gatsby-source-wordpress": "^3.1.54",
    "gatsby-source-wordpress-experimental": "^0.8.6",
    "gatsby-transformer-sharp": "^2.3.7",
    "graphql-tag": "^2.10.3",
    "hamburgers": "^1.1.3",
    "he": "^1.2.0",
    "isomorphic-fetch": "^2.2.1",
    "lodash": "^4.17.15",
    "node-sass": "^4.13.0",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-apollo": "^3.1.5",
    "react-dom": "^16.12.0",
    "react-helmet": "^5.2.1",
    "react-hook-form": "^4.3.0",
    "react-responsive-carousel": "^3.1.51",
    "react-typography": "^0.16.19",
    "typography": "^0.16.19",
    "typography-breakpoint-constants": "^0.16.19"
  },

Please let me know if I can provide any further information to aid debugging. Thank you!

Document why "WP Menus are not pulled into GraphQL"

I am converting a current WpGraphQL site over to using this package.

When viewing the query to fetch menus in the WordPress CMS panel using GraphiQL the data is visible. However when running 'gatsby develop' the data is not pulled into the Gatsby GraphQl.

Returns count of 0, rather than 2 - with no other data attached.

This applies to both menu fields:

  • allWpMenu
  • allWpMenuItem

Price null on allWpProduct query with wp-graphql-woocommerce

Hi @TylerBarnes ๐Ÿ‘‹
Thank you for the awesome work on this plugin ๐Ÿ™
I am pretty excited to build a woocommerce theme with gatsby-source-wordpress-experimental

However on testing it, I am getting price as null in the query.

image

Here is the link for my WIP repo

I saw some of the Github issues, where you have mentioned that wp-graphql-woocommerce currently not supported as its not tested.
Please let me know when we can use it with wp-graphql-woocommerce, when possible.

Build fails due to missing .terms field on WpMediaItem

gatsby build and gatsby start is failing due to missing terms field

  Error: Interface field WpContentNode.terms expected but WpMediaItem does not provide it.
  Interface field WpContentNode.terms expected but WpPage does not provide it.
  Type WpContentNodeToTermNodeConnection must define one or more fields.

Private reproduction (invite sent to @TylerBarnes): https://github.com/woodwoerk/nuori-fi-2020/tree/feature/latest-graphql-and-wp-gatsby

Versions:

  • gatsby-source-wordpress-experimental - 1.0.2
  • WP Gatsby - 0.4.8
  • WP GraphQL - 0.10.2

Full log:

> gatsby develop -H 0.0.0.0 -p 8000
success open and validate gatsby-configs - 0.060s
success load plugins - 2.093s
success onPreInit - 0.035s
success initialize cache - 0.101s
success copy gatsby files - 0.143s
success onPreBootstrap - 0.018s
โ €
info  gatsby-source-wordpress 
        This is either your first build or the cache was cleared.
        Please wait while your WordPress data is synced to your Gatsby cache.
        Maybe now's a good time to get up and stretch? :D
success  gatsby-source-wordpress  ingest WPGraphQL schema - 3.820s
success createSchemaCustomization - 7.438s
success  gatsby-source-wordpress  Tag - 2.472s - fetched 0
success  gatsby-source-wordpress  Taxonomy - 2.583s - fetched 3
success  gatsby-source-wordpress  ContentType - 2.808s - fetched 3
success  gatsby-source-wordpress  Menu - 3.157s - fetched 4
success  gatsby-source-wordpress  MenuItem - 3.645s - fetched 15
success  gatsby-source-wordpress  User - 3.686s - fetched 1
success  gatsby-source-wordpress  Category - 3.833s - fetched 18
success  gatsby-source-wordpress  Post - 5.414s - fetched 32
success  gatsby-source-wordpress  Page - 7.113s - fetched 50
 ERROR 
(node:12888) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
success Downloading remote files - 6.181s - 7/7 1.13/s
success Downloading remote files - 22.841s - 20/20 0.88/s
success Downloading remote files - 4.503s - 3/4 0.89/s
success Downloading remote files - 15.607s - 9/9 0.58/s
success Downloading remote files - 12.758s - 7/7 0.55/s
success Downloading remote files - 2.967s - 3/109 36.74/s
success  gatsby-source-wordpress  MediaItem - 101.651s - fetched 121
success  gatsby-source-wordpress  creating nodes - 101.672s
success  gatsby-source-wordpress  fetching nodes - 108.850s - 247 total
success Downloading remote files - 28.563s - 69/109 3.82/s
success  gatsby-source-wordpress  fetch root fields - 2.621s
success source and transform nodes - 111.623s
graphql-compose: Delete field 'WpMediaItem.terms' with type 'WpContentNodeToTermNodeConnection', cause it does not have fields.
graphql-compose: Delete field 'WpPage.terms' with type 'WpContentNodeToTermNodeConnection', cause it does not have fields.
success building schema - 0.873s
 ERROR #11321  PLUGIN
"gatsby-node.js" threw an error while running the createPages lifecycle:
Interface field WpContentNode.terms expected but WpMediaItem does not provide it.
Interface field WpContentNode.terms expected but WpPage does not provide it.
Type WpContentNodeToTermNodeConnection must define one or more fields.
  3 | 
  4 | exports.createPages = async (props) => {
> 5 |   await createContentNodes(props)
    |         ^
  6 |   await createArticlesPages(props)
  7 | }
  8 | 
File: gatsby-node.js:5:9
  Error: Interface field WpContentNode.terms expected but WpMediaItem does not provide it.
  Interface field WpContentNode.terms expected but WpPage does not provide it.
  Type WpContentNodeToTermNodeConnection must define one or more fields.
  - graphql-runner.js:79 GraphQLRunner.validate
    [nuori-fi-2020]/[gatsby]/dist/query/graphql-runner.js:79:44
  - graphql-runner.js:144 GraphQLRunner.query
    [nuori-fi-2020]/[gatsby]/dist/query/graphql-runner.js:144:25
  - create-graphql-runner.js:40 
    [nuori-fi-2020]/[gatsby]/dist/bootstrap/create-graphql-runner.js:40:19
  - create-content-nodes.js:13 module.exports
    C:/Users/joesm/Documents/nuori-fi-2020/gatsby/create/create-content-nodes.js:13:13       
  - gatsby-node.js:5 Object.exports.createPages
    C:/Users/joesm/Documents/nuori-fi-2020/gatsby-node.js:5:9
  - api-runner-node.js:259 runAPI
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:259:37
  - From previous event:
  - api-runner-node.js:261 runAPI
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:261:22
  - api-runner-node.js:378 Promise.catch.decorateEvent.pluginName
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:378:15
  - From previous event:
  - api-runner-node.js:377 
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:377:12
  - timers.js:456 processImmediate
    internal/timers.js:456:21
  - From previous event:
  - api-runner-node.js:371 
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:371:11
  - From previous event:
  - api-runner-node.js:278 module.exports
    [nuori-fi-2020]/[gatsby]/dist/utils/api-runner-node.js:278:12
  - create-pages.js:30 createPages
    [nuori-fi-2020]/[gatsby]/dist/services/create-pages.js:30:36
  - index.js:32 bootstrap
    [nuori-fi-2020]/[gatsby]/dist/bootstrap/index.js:32:35
  - develop-process.js:124 async module.exports
    [nuori-fi-2020]/[gatsby]/dist/commands/develop-process.js:124:7
failed createPages - 0.206s
success createPagesStatefully - 0.117s
graphql-compose: Delete field 'WpPost.terms' with type 'WpContentNodeToTermNodeConnection', cause it does not have fields.
success updating schema - 0.069s
success onPreExtractQueries - 0.006s
 ERROR 
Interface field WpContentNode.terms expected but WpMediaItem does not provide it.
Interface field WpContentNode.terms expected but WpPage does not provide it.
Interface field WpContentNode.terms expected but WpPost does not provide it.
Type WpContentNodeToTermNodeConnection must define one or more fields.
  Error: Interface field WpContentNode.terms expected but WpMediaItem does not provide it.
  Interface field WpContentNode.terms expected but WpPage does not provide it.
  Interface field WpContentNode.terms expected but WpPost does not provide it.
  Type WpContentNodeToTermNodeConnection must define one or more fields.
  - query-compiler.js:201 extractOperations
    [nuori-fi-2020]/[gatsby]/dist/query/query-compiler.js:201:20
  - query-compiler.js:175 processQueries
    [nuori-fi-2020]/[gatsby]/dist/query/query-compiler.js:175:7
  - query-compiler.js:95 compile
    [nuori-fi-2020]/[gatsby]/dist/query/query-compiler.js:95:19
  - extract-queries.js:26 async extractQueries
    [nuori-fi-2020]/[gatsby]/dist/services/extract-queries.js:26:3
  - index.js:35 async bootstrap
    [nuori-fi-2020]/[gatsby]/dist/bootstrap/index.js:35:3
  - develop-process.js:124 async module.exports
    [nuori-fi-2020]/[gatsby]/dist/commands/develop-process.js:124:7
not finished Generating image thumbnails - 103.474s
not finished extract queries from components - 1.116s
npm ERR! code ELIFECYCLE
npm ERR! errno 1

HTML Inline Images markup issue.

Hi Tyler,

Congratulations on the beta release!

I've been playing around with this on one of my WP sites and I noticed that the markup of inline images was a little off. Essentially, the gatsby-image-wrapper div was being preceded & followed with empty paragraph tags like the following.

<p></p>
<div class="gatsby-image-wrapper>
 {...}
</div>
<p></p>

I think this is due to WordPress's autop filter which automatically wraps images in P tags by default. I managed to fix this issue by running a filter on the_content on my WP install. I based the filter on this stack overflow post

Although this is pretty minor, I thought it was worth adding in case anyone else was having the same issue.

Add an API to skip fetching data for a field and resolve gatsby-side / add nested field Gatsby filters

For example, in the User.posts field we're currently fetching the id's of all connected nodes (up to 100 of them). This isn't necessary because we already know that Post nodes will have an author field and we can use that to resolve which nodes should be connected. Resolving this locally will also allow us to resolve more than 100 connected nodes.

The api might look something like:

{
  options: {
    type: {
      Author: {
        resolveLocalConnections: [
          {
            fieldName: `posts`,
            connectBy: `Post.author.node` // should be a 1:1 connection field back to the Author type.
          }
        ]
      }
    }
  }
}

Default options for this should be included for obvious fields like User.posts and wherever else makes sense.

Build error on WP Multisite

Using:
WPGraphQL v0.10.1
WPGatsby 0.4.1
gatsby-source-wordpress-experimental 0.7.14
WordPress Multisite + Woo 5.4.2
PHP 7.3.18
gatsby 2.23.12

Before migrating from gatsby-source-graphql I decided to start from scratch with this guide https://bit.ly/2BTyVv1
I got to the first build when I run into this...

ERROR
Interface field WpHierarchicalContentNode.wpParent expected but WpMediaItem does not provide it.
Type WpHierarchicalContentNodeToContentNodeConnectionEdge must define one or more fields.
Interface field WpHierarchicalContentNode.wpParent expected but WpPage does not provide it.
Type WpNodeWithRevisionsToContentNodeConnectionEdge must define one or more fields.

Error: Interface field WpHierarchicalContentNode.wpParent expected but WpMediaItem does not provide it.
Type WpHierarchicalContentNodeToContentNodeConnectionEdge must define one or more fields.
Interface field WpHierarchicalContentNode.wpParent expected but WpPage does not provide it.
Type WpNodeWithRevisionsToContentNodeConnectionEdge must define one or more fields.

@TylerBarnes is this an error you might have a cure for? :)

Feat: Add error message about self signed certs

When using https with a self signed cert, Node will error out. The error message should include a note about turning this off for local development (NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop).

Additionally, image downloads shouldn't be retried if they return this error.
RequestError: self signed certificate

This work will need to be done in src/steps/source-nodes/fetch-nodes/fetch-referenced-media-items.js somewhere below line 62.

info pushing https://gatsby.local/wp-content/uploads/2020/06/gesture-ranges.png to the end of the request queue.
info Previously retried 4 times already.
info
already re-queued https://gatsby.local/wp-content/uploads/2019/05/gatsby6.png 5 times :( sorry.
Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD.
It's currently set to 12
 ERROR 
failed to process https://gatsby.local/wp-content/uploads/2019/05/gatsby6.png
RequestError: self signed certificate
not finished source and transform nodes - 1937.489s
not finished Generating image thumbnails - 1930.883s
not finished  gatsby-source-wordpress  fetching nodes - 1879.031s - 528 total
not finished  gatsby-source-wordpress  creating nodes - 1863.170s
not finished  gatsby-source-wordpress  MediaItem - 1863.173s - fetched 143
not finished Downloading remote files - 17.005s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

401 on image

When sourcing form a site with Basic credentials I'm getting 401 unauthorized on 1 image then the dev server panics out. I'm wondering if the get request isn't being passed the basic auth credentials.

How can we access normalizers ?

Hello, i would like to know if we can access normalizers somewhere ?
(like normalizers in current gatsby-source-wordpress)

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.