Open jan-clockworkwp opened 5 months ago
Hey @jan-clockworkwp. Thank you for the report. I followed the steps you mentioned above, but I was able to query the new boolean field so I wasn't able to reproduce this issue in my setup.
Maybe this is related to this issue: https://github.com/wpengine/wp-graphql-content-blocks/issues/238
I do believe this is related to https://github.com/wpengine/wp-graphql-content-blocks/issues/238 as @theodesp indicates above. I will do some investigation and try to reproduce.
@jan-clockworkwp
https://github.com/wpengine/wp-graphql-content-blocks/releases/tag/v4.0.1
Should contain a fix for this issue. Please verify that it works and I can close this issue.
Well done @theodesp, both radio and checkbox controls are working now. I have just one comment that probably an update in the Faust official docs is needed. Let me explain why. In the official docs, the section Form Control Reference List
, RadioControl
is saying it should be of type boolean
. It works okay that way, but I can't see the reason for using radio buttons for true/false
over the CheckBoxControl
. If string values are used for RadioControl
in the options list, the attribute type needs to be changed to 'string' so they and default values work properly. According to this, it would make much more sense in the official docs to say that RadioControl should be of type string
.
Description
While working on a custom block and trying to use RadioControl and/or CheckboxControl fields, I am facing an ApolloError: Internal server error on the frontend. I have followed instructions from the official docs and https://github.com/wpengine/faustjs/pull/1573. Everything seems to be working; fields are properly rendered in the WP Admin, GraphQL schema is updated, the
codegen
script is not complaining either, the attribute is available for autocomplete when writing a query in GraphiQL. However, once the query is run, the following ApolloError is triggered. Below is an example of the error for thelinkShow
custom block attribute:This issue is not occurring for other custom attributes, only for these two (there may be others with a similar issue, but I have not tested them yet). I have tried various names for the custom attribute and played with different combinations of default values to no avail. Is there any better way to debug these ApolloErrors? Thanks for looking into this.
Steps to reproduce
block-support
example project.block-b
by adding new whatever named custom attribute with or without a default value, for example:Component.js
file by adding new attribute to theeditorFields
config:faust blockset
script to build modified block.Additional context
No response
@faustwp/core Version
3.0.1
@faustwp/cli Version
3.0.1
FaustWP Plugin Version
1.3.1
WordPress Version
6.5.2
Additional environment details
Please confirm that you have searched existing issues in the repo.