-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby-source-strapi): Generated Types #433
Comments
We'd love to see this, and agree it can be very annoying. A PR is welcome. |
I also did not like to add extra content, and found a workable solution @nimame.
Works with gatsby 5.7.0 |
Thanks for the suggestion @fgroenendijk. Would be cool if something like that could be integrated into the plugin and handled behind the scenes automatically. I had a look at the source of the plugin but I don't think I'm smart enough to do a PR myself :) |
Myself, I actually manually create all the types via |
I've used a lot of source plugins that use graphql. This is the first one that does this. I don't know how it ever got released in this state... |
Honestly the strapi plugin is so bad for so many different reasons it would probably be easier to fork the directus plugin and adapt the API. |
Any and all contributions would be welcome @robclancy. Strapi has passed the buck on maintenance and donated the plugin to us so folks could make improvements as needed. If you want to take charge on a major update I'm happy to support that effort. |
The Readme states the following limitation:
The fact that a site can break (does not build successfully) in those situations has turned out to be very annoying to me, even if it can be avoided by the mentioned workaround. And it makes optional fields on single types practically infeasible.
I think it should be feasible and would greatly improve the quality of the plugin. I didn't find any feature request or discussion on this topic, so I am raising it here.
Describe the solution you'd like
The plugin could explicitly generate data types based on the strapi schemas (which are already fetched here I think) before generating the nodes, e.g. using the
createTypes
hook (see Gatsby docs).Describe alternatives you've considered
The alternative suggested in the Readme (create "an extra content entry with all fields filled out") feels like a hack. It doesn't work for single-types. It would feel more intuitive, if an optional field in Strapi, could be treated as an optional field in Gatsby, too.
The text was updated successfully, but these errors were encountered: