externalItem query
Use the externalItem GraphQL query get a single entity.
Query syntax
The following code illustrates required format for the GraphQL request, followed by a description of the input values:
{
externalItem([eclUri: "ECL-URI"]
[identity: {
namespace: "NAMESPACE",
id: "IDENTIFIER",
type: "TYPE"
[,localeId: "LOCALE_ID"]
}])
{
... on TYPE {
RESPONSE_FIELD_1
RESPONSE_FIELD_2
RESPONSE_FIELD_n
}
}
}
Fields and inputs
- identity
- The
identityobject is formed from the following field values to uniquely identify the entity to be retrieved:- namespace
- Where NAMESPACE is the namespace where the external data is made available.
- id
- Where IDENTIFIER is the unique identifier provided by the external system.
- type
- Where TYPE refers to the external entity type.
- localId
- Where LOCAL_ID can be either a Publication ID or a locale string, such as 'en' or 'sv-se', which identifies a locale-specific variant of the entity.
- eclUri
- ECL-URI for the entity being requested.
- ... on TYPE
-
Defines the query response, where:
- TYPE is the entity type and matches the TYPE value in the identity section.
- RESPONSE_FIELD_1 to RESPONSE_FIELD_n are the specific data fields that you want to be returned in the response.
Example request and response
The first sample code block illustrates a request to retrieve a product (the entity type) based on its identity. The second code block illustrates the corresponding response with with the requested product details:
| Request | Response |
|---|---|
| |