Comments (4)
Hey @zhesha , I have encountered the same problem. This is the problem that can NOT be handled by gatsby source strapi but the solution that worked for me is here.
- do not leave optional fields and fill out all of them on your local strapi.
- yarn add gatsby-plugin-schema-snapshot on your gatsby project. docs.
- add this object into your gatsby-config file
{
// Path where the type definitions will be saved to
path: `schema.gql`,
update: true,
}
- now try to build your project with
yarn build
after that you would seeschema.gql
in the root of your gatsby project. - change
update: true,
toupdate: false,
in the gatsby-plugin-schema-snapsho config. - go ahead and make what ever you would like to be optional.
NOTE: never switch to update: true with empty fields because schema.gql would not create with all fields.
hope it works for you.
from gatsby-source-strapi.
assuming your component is named elements-background
, change to this:
createTypes(`
type STRAPI__COMPONENT_ELEMENTS_BACKGROUND implements Node {
color: String
}
type STRAPI_TOP_BAR implements Node {
background: STRAPI__COMPONENT_ELEMENTS_BACKGROUND @link(from: "id", by: "background___NODE")
}
`)
because the component is a relation, you need to link it
from gatsby-source-strapi.
The solution with gatsby-plugin-schema-snapshot works fine. Thanks, @everythinginjs. But I have a bunch of problems so I decided not to update, and stay in the previous version.
from gatsby-source-strapi.
Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or join us on Discord if you have questions!v
from gatsby-source-strapi.
Related Issues (20)
- Gatsby develop hangs for minutes on "Source and Transform Nodes" HOT 1
- Gatsby Source not fetching all locales date throwing an error
- Issue generating links for nested collection routes HOT 1
- Plugin doesn't update data when content on admin changes HOT 2
- Error: EPERM: operation not permitted, lstat HOT 2
- "Rich text" field makes a ERROR #11321 PLUGIN HOT 1
- How to fetch custom API HOT 4
- image from strapi component doesn't show up in graphql HOT 3
- Single Types don't update on rebuild if multiple locales exist HOT 1
- Missing images from richtext field HOT 1
- Image Processing in HTML code HOT 2
- Plugin is not pulling data from Strapi when there is a timestamp on the cache. HOT 1
- ERROR #11321 PLUGIN "gatsby-source-strapi" threw an error while running the sourceNodes lifecycle: connect ECONNREFUSED ::1:1337 HOT 5
- CreateTypes Camel case vs. snake case HOT 1
- Is this plugin still maintained? HOT 31
- Getting "Unknown type" for the starter project HOT 2
- Cannot retrieve sub-components of components in graphql? HOT 13
- GatsbyImageData in dynamic zones HOT 2
- Pull plugin comments data into Gatsby HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-strapi.