Skip to main content

EntityPresentationApi.forEntity()

Home > @backstage/plugin-catalog-react > EntityPresentationApi > forEntity

Fetches the presentation for an entity.

Signature:

forEntity(entityOrRef: Entity | string, context?: {
defaultKind?: string;
defaultNamespace?: string;
}): EntityRefPresentation;

Parameters

Parameter

Type

Description

entityOrRef

Entity | string

Either an entity, or a string ref to it. If you pass in an entity, it is assumed that it is not a partial one - i.e. only pass in an entity if you know that it was fetched in such a way that it contains all of the fields that the representation renderer needs.

context

{ defaultKind?: string; defaultNamespace?: string; }

(Optional) Contextual information that may affect the presentation.

**Returns:**

EntityRefPresentation