Closed tcherokee closed 3 years ago
So I just set up a brand new gatsby install with just the gatsby-source-craft plugin and I am still getting the error unfortunately.
Ok figured it out. Not a bug. I was trying to pull in Verbb/Navigation Plugin as well and that was what was causing the issue. From the documentation, I am guessing I have to configure Navigation to use the plugin.
Okay, so I fixed this.
There were a couple of issues here at play.
1) Navigation plugin exposes the related elements in the navigation trees using the ElementInterface
GraphQL interface type. This Interface is not referred to or returned by any Query, so, by looking at queries, there's no reason for Gatsby GraphQL Toolkit to even start figuring out what that interface is based on Queries.
2) There was an actual bug where some behavior was bleeding over from the experimental behavior (when setting looseInterfaces
to true
), which actually triggered the behavior of (1) to blow up. Namely, enabling the experimental behavior rewrites the Schema a bit and forgets the interface definitions for types, so, based on (1), Gatsby, in essence, loses all knowledge of the ElementInterface type, since it is not referred to by queries OR types at this point. So, it implodes when encountering the Navigation plugin because it does not know what to do with the ElementInterface.
I've patched so that this will still be a bug, if looseInterfaces
is enabled, but really, we strongly discourage using that experimental behavior (for good reason).
If this ever comes up again and the experimental behavior is required, we'll probably try to engineer around it, but, currently, it's not worth the effort and added complexity.
I'll see if we can get a release out today for this plugin.
Description
Hey There,
So I just installed gatsby-source-craft and when I ran
gatsby develop
, I ran into the following errorright after this error it seems to hang on building schema.
I have run gatsby clean a number of times, deleted my
.cache
folder to no avail.Additional info
Craft version: Craft Pro 3.5.17.1
PHP version: 7.4.7
Database driver & version: MySQL 5.7.32
Plugins & versions: Amazon S3 1.2.11 Feed Me 4.3.4 Gatsby Helper 1.0.0-beta.2 Imager X v3.2.6 Navigation 1.4.12 Redactor 2.8.5 Scout 2.1.4 SEOmatic 3.3.29
npmPackages: fontawesome-pro 5.14.0 fontawesome-svg-core 1.2.30 mdx 1.6.22 @popmotion/popcorn 0.4.4 @robinmetral/gatsby-source-s3 2.1.1 algoliasearch 4.8.3 babel-plugin-styled-components 1.12.0 framer-motion 2.6.7 gatsby 2.24.49 gatsby-plugin-mdx 1.9.0 gatsby-plugin-react-helmet 3.8.0 gatsby-plugin-sharp 2.12.1 gatsby-plugin-styled-components 3.8.0 gatsby-source-craft 1.0.0-beta.2 gatsby-source-filesystem 2.9.0 gatsby-source-graphql 2.12.0 gatsby-transformer-sharp 2.10.1 polished 3.6.5 react 16.13.1 react-alice-carousel 2.2.1 react-autosuggest 10.1.0 react-dom 16.13.1 react-helmet 6.1.0 react-instantsearch-dom 6.8.2 react-rating 2.0.5 react-tooltip 4.2.8 styled-components 5.1.1
I am not exactly sure what could be causing this as I can pull the data using the gatsby-source-graphql plugin.