craftcms / gatsby-source-craft

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

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

Closed danieladarve closed 3 years ago

danieladarve commented 3 years ago

Hey Guys,

Not sure if this is the right place to post this as it only happens when Verbbs Formie plugin is installed in CraftCMS, but once the plugin tries to source the Schema, it fails with the following errors.

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

Failed to execute query LIST_home_home_Entry.
Errors:
Fields "limit" conflict because they return conflicting types String and Boolean. Use different aliases on the fields to fetch both if this was intentional.

Fields "defaultValue" conflict because they return conflicting types String and Boolean. Use different aliases on the fields to fetch both if this was intentional.

Fields "defaultValue" conflict because they return conflicting types DateTime and String. Use different aliases on the fields to fetch both if this was intentional.

Fields "defaultValue" conflict because they return conflicting types String and DateTime. Use different aliases on the fields to fetch both if this was intentional.

Fields "multiple" conflict because they return conflicting types Boolean and String. Use different aliases on the fields to fetch both if this was intentional.

Field "settings" of type "FormSettingsInterface" must have a sub selection.

The previous list goes for long and then it finally fails with the following message

error Missing onError handler for invocation 'building-schema', error was 'Error: Type with name "FormSettingsInterface" does not exists'.

Querying the field via CraftCMS's graphql explorer works just fine.

Additional info

Using

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 87.0.4280.67
    Firefox: 82.0.2
    Safari: 14.0.1
  npmPackages:
    gatsby: 2.27.0 => 2.27.0
    gatsby-plugin-env-variables: ^2.0.0 => 2.0.0
    gatsby-plugin-postcss: ^2.1.13 => 2.3.13
    gatsby-plugin-purgecss: ^4.0.1 => 4.0.1
    gatsby-plugin-react-helmet: ^3.6.0 => 3.6.0
    gatsby-plugin-react-helmet-canonical-urls: ^1.4.0 => 1.4.0
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
    gatsby-plugin-resolve-src: ^2.1.0 => 2.1.0
    gatsby-plugin-styled-components: ^3.6.0 => 3.6.0
    gatsby-plugin-styled-jsx: ^3.6.0 => 3.6.0
    gatsby-source-craft: 1.0.0-beta.2 => 1.0.0-beta.2
  npmGlobalPackages:
    gatsby-cli: 2.15.0

CraftCMS Additional info

Craft CMS 3.5.16 PHP version | 7.4.10

PLUGINS Formie | 1.3.2 Gatsby Helper 1.0.0-beta.2

andris-sevcenko commented 3 years ago

All in all, this seems like a Formie issue. I opened a bug issue over at their repo. Once the dust settles on that one, we'll see what's what.

In the meantime, I've also recommended @engram-design to also implement schema components so it's possible to exclude Formie from Gatsby schemas.

danieladarve commented 3 years ago

Thanks @andris-sevcenko , I am wondering if it would be possible to override the values for these fields using the "sourcingParams" option of the gatsby-source-craft plugin or a custom fragment as a workaround?

andris-sevcenko commented 3 years ago

@danieladarve the best way to work around this for now would be to override the sourced fragments - here's more info on how to do that!