Giter Site home page Giter Site logo

Comments (4)

everythinginjs avatar everythinginjs commented on September 7, 2024

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.

  1. do not leave optional fields and fill out all of them on your local strapi.
  2. yarn add gatsby-plugin-schema-snapshot on your gatsby project. docs.
  3. add this object into your gatsby-config file
{
  // Path where the type definitions will be saved to
  path: `schema.gql`,
  update: true,
}
  1. now try to build your project with yarn build after that you would see schema.gql in the root of your gatsby project.
  2. change update: true, to update: false, in the gatsby-plugin-schema-snapsho config.
  3. 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.

laurenskling avatar laurenskling commented on September 7, 2024

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.

zhesha avatar zhesha commented on September 7, 2024

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.

moonmeister avatar moonmeister commented on September 7, 2024

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)

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.