Skip to content

adminAppearanceSectionFields

The field set a section's type is built from, together with the values it currently holds. This is what makes a client-side editor possible without knowing the six types in advance: render the schema, fill it from options, and send the result to createAdminAppearanceSectionDraft.

Arguments

ArgumentTypeDescription
sectionIdInt!Section ID.
localeStringLocale the options are read in. Falls back to the channel locale.

Fields

FieldTypeDescription
sectionIdIntSection the fields belong to.
typeStringSection type the schema describes.
localeStringLocale the options were read in.
schemaIterableThe field set for the type.
optionsIterableValues currently held — staged when there are any, otherwise published.

Use cases

  • Render an editor for any section type — one code path handles all six.
  • Round-trip an edit — read options, change what the merchant edited, stage the whole object.

Best practices

  • The argument is sectionId, a plain Int — not id, and not an IRI. id is reserved for the resource IRI on a GraphQL item query, so the section is named explicitly.
  • schema and options are JSON values and take no sub-selection.
  • options resolves staged over published, which is what the editor should show.

Permissions

Requires appearance.sections.

Released under the MIT License.