Hello,
I get an error when I’m trying to set up an gatsby preview field by migration file. Unfortunately, I’m getting several errors, no matter what parameters I’m adding inside appearance object. Here’s sample code:
const gatsbypreview = await client.fields.create(itemTypeId, {
label: 'Gatsby Preview',
fieldType: 'json',
apiKey: 'gatsbypreview',
validators: {
required: {},
},
appearance: {
editor: 'json',
parameters: {},
addons: [
{
"id": "MY_PLUGIN_ID",
"parameters": {
"developmentMode": true,
},
},
],
},
});
I’m getting MY_PLUGIN_ID by sending request on https://site-api.datocms.com/plugins.
I tried to set in addons array attributes like:
- “type”: “plugin”,
- inside parameters object:
- authToken
- instanceUrl
- developmentMode as above
, but I’m still getting 422 Error - “422 INVALID_FIELD (details: {“field”:“appearance.addons.0.id”,“code”:“VALIDATION_INVALID”,“message”:“incompatible with field type”})”
Do you have any idea which attributes are valid for this field type? It’s not mentioned in docs to be honest