Skip to content
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]: example with graphql data #27

Open
drj8022 opened this issue Mar 5, 2024 · 1 comment
Open

[feat]: example with graphql data #27

drj8022 opened this issue Mar 5, 2024 · 1 comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature

Comments

@drj8022
Copy link

drj8022 commented Mar 5, 2024

A clear and concise description of what the feature is

This is a great plugin, thank you for putting it together! I'm trying to use this in my project, but I can't figure out how to properly query the data I need from GraphQL. If I select everything possible from a "Rich text (Blocks)" component, it only works if literally every kind of content has been added. Or if I select only the most basic elements from GraphQL it will appear "broken" when, for example, italic text is entered and the text does not appear italic. (If that makes any sense lol)

Basically if you request italic text--and there isn't any--the query breaks. If you don't request italic text--and users have entered it--the query works... but you don't get the italic text. So how do I make everything optional?

Why should this feature be included?

It will get developers using GraphQL up and running much faster. In my case, I happen to be using Gatsby. It does provide an error message linking to this page, but unfortunately I don't have enough experience with GraphQL, and there is some nesting and complexity with this plugin.

Please provide an example for how this would work

Ideally there would be a GraphQL query like this:
myrichtextblocksfield { type level format image { alternativeText url } children { bold italic strikethrough text type url underline children { text type } } }

It should work whether or not supported content has been entered. Lists, bold text, underlines, images, and so on. Basically how do I create a nested type definition where everything is optional?

@drj8022 drj8022 added the issue: enhancement Issue suggesting an enhancement to an existing feature label Mar 5, 2024
@joshuaellis
Copy link
Contributor

I think this needs to be on the strapi repo. @remidej what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants