importPortalPartSource

Topics: Surfaces

Read a .portal page or component file into the model's shape without saving anything. Returns valid; identified, true when the file names its part (<page route>, <component name>) and false for bare blocks, whose route or name the caller supplies; part, the portal_page or portal_component model object, or null when the file cannot be read; and diagnostics, each with its model path, message, severity and sourceRange in the file.

Returns

JSON!

Arguments

Whether the file holds a page or a component.

Possible values (2)
PAGE

A page: <page route> or its blocks (template, server, handlers, style).

COMPONENT

A component: <component name> or its blocks (props, template, style, server).

source

String!Required

The .portal file's text: the part's element, or its bare blocks.

Exact field SDL
"""
Read a `.portal` page or component file into the model's shape without saving anything. Returns `valid`; `identified`, true when the file names its part (`<page route>`, `<component name>`) and false for bare blocks, whose route or name the caller supplies; `part`, the `portal_page` or `portal_component` model object, or null when the file cannot be read; and `diagnostics`, each with its model `path`, `message`, `severity` and `sourceRange` in the file.
"""
importPortalPartSource(
  """Whether the file holds a page or a component."""
  kind: PortalPartKind!
  """The `.portal` file's text: the part's element, or its bare blocks."""
  source: String!
): JSON! @topic(names: ["surfaces"])

Declared on Query. Access is checked by the platform for each operation.