gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

Strapi v4 beta version limitations

Open pepijn-vanvlaanderen opened this issue 3 years ago • 4 comments

Great work on the new beta version supporting v4! Though I am curious where on the roadmap on the new version this limitation is set:

  1. At the moment, fields that do not have at least one populated instance will not be created in the GraphQL schema. This can break your site when field values get removed. You may workaround with an extra content entry with all fields filled out.

This is really inconvenient when having many components inside a Dynamic Zone and the workaround is a hassle to keep in sync. Why not use the great GraphQL API Strapi has? Also see the PoC by https://github.com/relate-app/gatsby-source-strapi

pepijn-vanvlaanderen avatar Feb 25 '22 10:02 pepijn-vanvlaanderen

When was is released? I created my project 2 weeks ago and just started with strapi. Not sure if the version i'm using supports strapi v4.

    "@strapi/plugin-graphql": "^4.1.0",
    "@strapi/plugin-i18n": "4.1.0",
    "@strapi/plugin-users-permissions": "4.1.0",
    "@strapi/strapi": "4.1.0",
    "sqlite3": "5.0.2"

muscaiu avatar Mar 01 '22 10:03 muscaiu

@muscaiu the version of Strapi you are using is compatible with the beta version of the source plugin, you should be good to go.

soupette avatar Mar 01 '22 16:03 soupette

@muscaiu it looks like you have a Strapi v4 application. To use Gatsby with it, you'll need the 2.0 version of gatsby-source-strapi in your Gatsby app.

@pepijn-vanvlaanderen you're highlighting an important problem. But I don't think using the GraphQL API would be the best solution, since it requires installing the graphql plugin and enabling introspection in production. Another approach would be to use the content-types-builder's API to generate the Gatsby types, even when there's no data.

remidej avatar Mar 01 '22 17:03 remidej

Another approach would be to use the content-types-builder's API to generate the Gatsby types

@remidej when you have a moment, could you elaborate on this solution? Is this documented anywhere? It'd be great if it is, as this is, as you say yourself, an important problem. Thanks!

jasewarner avatar Apr 07 '22 11:04 jasewarner

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!

moonmeister avatar Dec 27 '22 18:12 moonmeister