craftcms / gatsby-source-craft

Gatsby source plugin for Craft CMS.
MIT License
54 stars 13 forks source link

GraphQL error after installing Formie plugin #52

Closed andreasottosson closed 3 years ago

andreasottosson commented 3 years ago

Description

Installing Formie throws the following error. We have tried enabling all "Formie" related checkboxes under GQL schema settings but we won't use that, anyway enabling them just throws another error. If we disable Formie the error goes away.

success fetching Form - 12.772s

 ERROR #11330  PLUGIN

"gatsby-source-craft" threw an error while running the sourceNodes lifecycle:

Variable "$id" is not defined

  468 |     if (remoteConfigVersion !== localConfigVersion || !localContentUpdateTime) {
  469 |         reporter.info("Cached content is unavailable or outdated, sourcing _all_ nodes.");
> 470 |         await sourceAllNodes(config);
      |         ^
  471 |     }
  472 |     else {
  473 |         reporter.info(`Craft config version has not changed since last sourcing. Checking for content changes since "${localContentUpdateTime}".`);

Make sure that you don't have a typo somewhere and use valid arguments in sourceNodes lifecycle.
Learn more about sourceNodes here: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#sourceNodes

File: node_modules/gatsby-source-craft/gatsby-node.js:470:9

success Checking for changed pages - 0.001s

This is the error with all checkboxes enabled under "Formie" in the GraphQL settings.

 ERROR #11321  PLUGIN

"gatsby-node.js" threw an error while running the createPages lifecycle:

Interface field Craft_FormInterface.fields expected but Craft_Form does not provide it.

  4 |   const { createPage } = actions
  5 |
> 6 |   const result = await graphql(`
    |                        ^
  7 |     query {
  8 |       allCraftPagesStandardEntry {
  9 |         nodes {

File: gatsby-node.js:6:24

  Error: Interface field Craft_FormInterface.fields expected but Craft_Form does not provide it.

Steps to reproduce

  1. Install Formie
  2. Run "gatsby develop"

Additional info

andris-sevcenko commented 3 years ago

That's a bit odd.

If you're not going to use Formie in Gatsby, have you tried editing the generated fragments to exclude Formie from the sourcing queries?

I've written about it before, so to avoid repeating myself, you can find more reading by using this as a starting point!

andris-sevcenko commented 3 years ago

Related: https://github.com/verbb/formie/issues/343

andris-sevcenko commented 3 years ago

This should be resolved after updating Formie to 1.4.21