Prevent use of Block labels as IDs #515
chladog
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
Hey @chladog — I see your reasoning here, especially as it relates to future plans of being able to localize field labels within Admin UI. We'll certainly be addressing this at some point. We've got a few things on the radar that will take precedence but as this overlaps with #497, as you mentioned, it will certainly be addressed. 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If defined
Block label
alters GraphQL union types.Initial state:
GQL query for above:
We add labels:
GQL query needs to be changed to:
This goes against general practice that ids/slugs are semi-permanent values that normally doesn't change as implementations depend on them. Labels on the other hand are generaly: safe to change, being localized, can be dynamic etc.
This also prohibits to localize labels even staticly:
Textové pole
=>Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"Textovépole\" does not.
and use of special characters as&, #, $
I propose change for Block field to never use labels as identificators in schema (and anywhere).
This goes hand-in-hand with proposed with #497 that could be applied to labels to allow i18n.
Additionally character casing of the slug would make it more predictable (formText could be accessed with: ...on formText), though I'm not sure whether this is possible in GQL or not.
Beta Was this translation helpful? Give feedback.
All reactions