Body Parameters
default_value Optional boolean, null, string, number, object Example: {"en":"A default value","it":"Un valore di default"}
Default value for Field. When field is localized accepts an object of default values with site locales as keys
label Optional string Example: "Title"
api_key Optional string Example: "title"
localized Optional boolean Example: true
Whether the field needs to be multilanguage or not
validators Optional object Example: {"required":{}}
Optional field validations
appearance Optional object Example: {"editor":"single_line","parameters":{"heading":false},"addons":[{"id":"1234","field_extension":"lorem_ipsum","parameters":{}}]}
Field appearance details, plugin configuration and field add-ons
position Optional integer Example: 1
field_type Optional enum Example: "string"
hint Optional string, null Example: "This field will be used as post title"
deep_filtering_enabled Optional boolean Example: true
Whether deep filtering for block models is enabled in GraphQL or not
fieldset Optional null, { type: "fieldset", id: fieldset.id } Returns
Returns a
field resource object.
Examples
Example Basic example
import { buildClient } from '@datocms/cma-client-node';
async function run() {
const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
const fieldIdOrApiKey = 'blog_post::title';
const field = await client.fields.update(fieldIdOrApiKey, {});
console.log(field);
}
run();