verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

GQL: certain data types always have {text: ""} in response #121

Closed tremby closed 1 year ago

tremby commented 2 years ago

Description

I've noticed that certain data types always come back with "text": "", but I can't see any way that they would be populated.

I could be missing something, but I think all possible content would be in the content key. Maybe text is vestigial in these cases? If so, it's confusing to the developer and would be better removed.

I've seen it on

Additional info

Additional context

engram-design commented 2 years ago

Yep, we probably need to clean this up, as all nodes use the same interface, and therefore have shared attributes - some of which aren't applicable.

tremby commented 2 years ago

It's odd then that paragraphs within blockquotes have "text", whereas paragraphs not inside blockquotes do not.

This could also be made less confusing with documentation, if changing the structure would be a pain. For example the "text" property could have docs saying something like "only applies to nodes of these types: ... and will otherwise always be empty".

engram-design commented 2 years ago

Yep, we're largely locked-in to the schema structure (there are ways around it but just makes everything more complex), so maybe we just need to normalise things a little better. But agreed on some clearer docs explaining the difference (I'm still on the fence about leaving as-is or improving, which would be why there's none yet)

engram-design commented 1 year ago

Fixed in 2.1.0