You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using widget: "number, required: false, if you:
Working correctly: Leave the field blank and publish the item, the yaml file will not include the field name under the item. For example, if the field name is foo and there is another bar field that is required, the yaml file will be:
item:
- bar: 7
Working correctly: Enter a number to the field and republish the item, the yaml file will include the field with the correct value. For example:
item
- bar: 7
- foo: 3
NOT WORKING CORRECTLY: Complete step 2 above, then go back to the item and delete the number from the field then republish the item, the yaml file will include the field with an empty string as it's value. For example:
item
- bar: 7
- foo: ''
This causes issues when using GraphQL as:
The schema type cannot be inferred. In situation 1 above, there is no foo field so attempting to query foo will result in an error. This means schema type must be explicitly set.
Describe the bug
When using
widget: "number, required: false
, if you:yaml
file will not include the field name under the item. For example, if the field name isfoo
and there is anotherbar
field that is required, the yaml file will be:yaml
file will include the field with the correct value. For example:yaml
file will include the field with an empty string as it's value. For example:This causes issues when using GraphQL as:
The schema type cannot be inferred. In situation 1 above, there is no
foo
field so attempting to queryfoo
will result in an error. This means schema type must be explicitly set.You can't explicitly set the schema type for
foo
as it can be eitherString
orInt
, and GraphQL doesn't support union scalar types.To Reproduce
Create a field with
widget: "number", required: false
then run through the three situations above.Expected behavior
If no number is entered then it should either leave the field out of the
yaml
file, or define the value asnull
.Applicable Versions:
CMS configuration
Relevant sections only:
The text was updated successfully, but these errors were encountered: