verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
94 stars 72 forks source link

GraphQL error when selecting "conditions" field: "String cannot represent value ..." #843

Closed tremby closed 2 years ago

tremby commented 2 years ago

Description

When querying for field conditions I am seeing an error. It looks like it's trying to put an object in a string field without encoding it as JSON or similar.

Steps to reproduce

  1. Make a field in a form. Don't have to set any conditions on it.
  2. Query for conditions on that field via GQL.
{
  "errors": [
    {
      "message": "String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]}",
      "extensions": {
        "category": "graphql"
      }
    },
    {
      "message": "String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]}",
      "extensions": {
        "category": "graphql"
      }
    },
    {
...

Form settings

Please pick from the options below.

Additional info

engram-design commented 2 years ago

Looks like this is due to type changes in Craft 4, but I've re-jigged things. Fixed in the craft-4 branch.

engram-design commented 2 years ago

Fixed in 2.0.0-beta.2

tremby commented 2 years ago

I'm still getting the same error. I'm at d646ac28.

{
  "errors": [
    {
      "message": "String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]}",
      "extensions": {
        "category": "graphql"
      }
    },
    {
      "message": "String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]}",
      "extensions": {
        "category": "graphql"
      }
    },
...

I tried clearing all caches, and re-saving the form.

In the log I'm seeing another error before all these "string cannot represent value" errors, but I'm not sure it's related because I see this one even if I do not query for conditions.

2022-04-25 18:28:05 [web.WARNING] [craft\models\FieldLayoutTab::setElements] Invalid field layout element config: Invalid field UID: 4d597396-ee7f-485c-aeda-5b033cc807ff {"memory":40539584} 
2022-04-25 18:28:05 [web.ERROR] [yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: Invalid field UID: 4d597396-ee7f-485c-aeda-5b033cc807ff in /srv/my-project/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php:106
Stack trace:
#0 /srv/my-project/vendor/yiisoft/yii2/base/Component.php(180): craft\fieldlayoutelements\CustomField->setFieldUid('4d597396-ee7f-4...')
#1 /srv/my-project/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('fieldUid', '4d597396-ee7f-4...')
#2 /srv/my-project/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\fieldlayoutelements\CustomField), Array)
#3 /srv/my-project/vendor/craftcms/cms/src/base/Model.php(78): yii\base\BaseObject->__construct(Array)
#4 /srv/my-project/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(59): craft\base\Model->__construct(Array)
#5 /srv/my-project/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(39): craft\fieldlayoutelements\BaseField->__construct(Array)
#6 [internal function]: craft\fieldlayoutelements\CustomField->__construct(NULL, Array)
#7 /srv/my-project/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#8 /srv/my-project/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\fieldlayo...', Array, Array)
#9 /srv/my-project/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\fieldlayo...', Array, Array)
#10 /srv/my-project/vendor/craftcms/cms/src/Craft.php(53): yii\BaseYii::createObject(Array, Array)
#11 /srv/my-project/vendor/craftcms/cms/src/services/Fields.php(1273): Craft::createObject(Array)
#12 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayoutTab.php(291): craft\services\Fields->createLayoutElement(Array)
#13 /srv/my-project/vendor/yiisoft/yii2/base/Component.php(180): craft\models\FieldLayoutTab->setElements(Array)
#14 /srv/my-project/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('elements', Array)
#15 /srv/my-project/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\models\FieldLayoutTab), Array)
#16 /srv/my-project/vendor/craftcms/cms/src/base/Model.php(78): yii\base\BaseObject->__construct(Array)
#17 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayoutTab.php(123): craft\base\Model->__construct(Array)
#18 /srv/my-project/vendor/craftcms/cms/src/services/Fields.php(1196): craft\models\FieldLayoutTab->__construct(Array)
#19 /srv/my-project/vendor/craftcms/cms/src/services/Fields.php(1174): craft\services\Fields->_createLayoutTabFromRow(Array, true)
#20 [internal function]: craft\services\Fields->craft\services\{closure}(Array)
#21 /srv/my-project/vendor/craftcms/cms/src/services/Fields.php(1173): array_map(Object(Closure), Array)
#22 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayout.php(254): craft\services\Fields->getLayoutTabsById(30)
#23 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayout.php(736): craft\models\FieldLayout->getTabs()
#24 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayout.php(585): craft\models\FieldLayout->_elements(Object(Closure), NULL)
#25 /srv/my-project/vendor/craftcms/cms/src/models/FieldLayout.php(562): craft\models\FieldLayout->_customFields()
#26 /srv/my-project/vendor/craftcms/cms/src/behaviors/FieldLayoutBehavior.php(150): craft\models\FieldLayout->getCustomFields()
#27 [internal function]: craft\behaviors\FieldLayoutBehavior->getCustomFields()
#28 /srv/my-project/vendor/yiisoft/yii2/base/Component.php(297): call_user_func_array(Array, Array)
#29 /srv/my-project/vendor/craftcms/cms/src/gql/base/Generator.php(41): yii\base\Component->__call('getCustomFields', Array)
#30 /srv/my-project/vendor/verbb/navigation/src/gql/types/generators/NodeGenerator.php(50): craft\gql\base\Generator::getContentFields(Object(verbb\navigation\models\Nav))
#31 /srv/my-project/vendor/verbb/navigation/src/gql/types/generators/NodeGenerator.php(35): verbb\navigation\gql\types\generators\NodeGenerator::generateType(Object(verbb\navigation\models\Nav))
#32 /srv/my-project/vendor/verbb/navigation/src/gql/interfaces/NodeInterface.php(43): verbb\navigation\gql\types\generators\NodeGenerator::generateTypes()
#33 /srv/my-project/vendor/verbb/navigation/src/gql/queries/NodeQuery.php(26): verbb\navigation\gql\interfaces\NodeInterface::getType()
#34 /srv/my-project/vendor/verbb/navigation/src/Navigation.php(206): verbb\navigation\gql\queries\NodeQuery::getQueries()
#35 [internal function]: verbb\navigation\Navigation->verbb\navigation\{closure}(Object(craft\events\RegisterGqlQueriesEvent))
#36 /srv/my-project/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\RegisterGqlQueriesEvent))
#37 /srv/my-project/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\\services\\...', 'registerGqlQuer...', Object(craft\events\RegisterGqlQueriesEvent))
#38 /srv/my-project/vendor/craftcms/cms/src/services/Gql.php(1349): yii\base\Component->trigger('registerGqlQuer...', Object(craft\events\RegisterGqlQueriesEvent))
#39 /srv/my-project/vendor/craftcms/cms/src/services/Gql.php(360): craft\services\Gql->_registerGqlQueries()
#40 /srv/my-project/vendor/craftcms/cms/src/services/Gql.php(495): craft\services\Gql->getSchemaDef(Object(craft\models\GqlSchema), true)
#41 /srv/my-project/vendor/craftcms/cms/src/controllers/GraphqlController.php(177): craft\services\Gql->executeQuery(Object(craft\models\GqlSchema), '{\n  formieForm(...', NULL, NULL, true)
#42 [internal function]: craft\controllers\GraphqlController->actionApi()
#43 /srv/my-project/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#44 /srv/my-project/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#45 /srv/my-project/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('api', Array)
#46 /srv/my-project/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('graphql/api', Array)
#47 /srv/my-project/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('graphql/api', Array)
#48 /srv/my-project/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#49 /srv/my-project/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#50 /srv/my-project/web/index.php(12): yii\base\Application->run()
#51 {main} {"memory":40539960,"exception":"[object] (yii\\base\\InvalidArgumentException(code: 0): Invalid field UID: 4d597396-ee7f-485c-aeda-5b033cc807ff at /srv/my-project/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php:106)"} 
2022-04-25 18:28:05 [web.ERROR] [GraphQL\Error\Error] String cannot represent value: {"showRule":"show","conditionRule":"all","conditions":[]} {"memory":56416864,"exception":"[object] (GraphQL\\Error\\Error(code: 0): String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]} at /srv/my-project/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php:42)"} 
2022-04-25 18:28:05 [web.ERROR] [GraphQL\Error\Error] String cannot represent value: {"showRule":"show","conditionRule":"all","conditions":[]} {"memory":56417272,"exception":"[object] (GraphQL\\Error\\Error(code: 0): String cannot represent value: {\"showRule\":\"show\",\"conditionRule\":\"all\",\"conditions\":[]} at /srv/my-project/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php:42)"} 
...

Something else I've noticed since updating today is that I get a lot of schema errors. I can open Graphiql and I haven't even executed a query yet but get a lot of errors in the output pane:

{
  "errors": [
    "Interface field FieldInterface.limit expects type Boolean but Field_Address.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Address.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Address.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Address.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Address.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Agree.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Agree.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Agree.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Agree.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Agree.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Agree.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Calculations.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Calculations.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Calculations.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Calculations.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Calculations.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Categories.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Categories.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Categories.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Categories.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Categories.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Categories.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Checkboxes.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Checkboxes.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Checkboxes.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Checkboxes.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Checkboxes.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Checkboxes.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Date.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Date.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Date.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Date.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Date.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Date.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Dropdown.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Dropdown.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Dropdown.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Dropdown.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Dropdown.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Dropdown.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Email.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Email.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Email.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Email.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Email.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Entries.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Entries.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Entries.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Entries.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Entries.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Entries.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_FileUpload.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_FileUpload.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_FileUpload.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_FileUpload.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_FileUpload.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_FileUpload.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Group.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Group.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Group.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Group.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Group.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Group.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Heading.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Heading.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Heading.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Heading.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Heading.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Heading.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Hidden.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Hidden.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Hidden.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Hidden.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.enableConditions expects type Boolean but Field_Hidden.enableConditions is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Html.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Html.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Html.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Html.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Html.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Html.enableContentEncryption is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_MultiLineText.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_MultiLineText.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_MultiLineText.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_MultiLineText.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Name.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Name.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Name.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Name.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Name.includeInEmail is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Number.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Number.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Number.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Number.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Number.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Password.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Password.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Password.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Password.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Password.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Phone.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Phone.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Phone.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Phone.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Phone.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Radio.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Radio.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Radio.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Radio.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Radio.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Radio.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Recipients.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Recipients.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Recipients.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Recipients.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Recipients.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Repeater.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Repeater.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Repeater.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Repeater.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Repeater.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Repeater.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Section.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Section.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Section.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Section.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Section.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Section.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Signature.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Signature.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Signature.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Signature.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Signature.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Signature.enableContentEncryption is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_SingleLineText.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_SingleLineText.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_SingleLineText.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_SingleLineText.includeInEmail is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Summary.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Summary.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Summary.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Summary.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Summary.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Summary.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Table.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Table.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Table.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Table.inputAttributes is type String.",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Table.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Table.enableContentEncryption is type String.",
    "Interface field FieldInterface.limit expects type Boolean but Field_Users.limit is type String.",
    "Interface field FieldInterface.limitAmount expects type Int but Field_Users.limitAmount is type String.",
    "Interface field FieldInterface.containerAttributes expects type [FieldAttribute] but Field_Users.containerAttributes is type [KeyValueType].",
    "Interface field FieldInterface.inputAttributes expects type [FieldAttribute] but Field_Users.inputAttributes is type [KeyValueType].",
    "Interface field FieldInterface.includeInEmail expects type Boolean but Field_Users.includeInEmail is type String.",
    "Interface field FieldInterface.enableContentEncryption expects type Boolean but Field_Users.enableContentEncryption is type String."
  ]
}

I've no idea if it's related.

engram-design commented 2 years ago

Yep, still improving typing thanks to PHP 8, we can ditch a lot of what we were doing for Craft 3 that was a bit too fancy for it's own good. Now, we can rely on the original property's type for the field, for GraphQL queries.

Fixed for the next release. To get this fix early, change your verbb/formie requirement in composer.json to:

"require": {
  "verbb/formie": "dev-craft-4 as 2.0.0-beta.2",
  "...": "..."
}

Then run composer update.

tremby commented 2 years ago

Great; those errors have disappeared, except for the "Invalid field layout" one. Do you want me to open another ticket for that? I'm not aware of it actually causing any problems as yet, and I'm not sure what's causing it.

tremby commented 2 years ago

Also, I see that the conditions field comes out a JSON string. Is that as expected?

engram-design commented 2 years ago

Hmmm, might be unrelated, but yep a new issue!

And yes, the conditions is just a JSON string, I thought it was overkill typing that into its own interface. Sometime soon we'll have a front-end package on npm that'll allow you to parse it (among other things Formie does). But for now, it's up to you to handle that logic (tip - https://github.com/verbb/formie/blob/craft-3/src/web/assets/frontend/src/js/fields/conditions.js)

tremby commented 2 years ago

Hmmm, might be unrelated, but yep a new issue!

I looked into that one a bit, and it's not related to Formie -- sorry about the noise there. It's likely some corrupt field elsewhere.

Understood regarding the JSON.