Attachment
Represents a file or link attached to a product.
Type Definition
type Attachment {
name: String
href: String
}
Fields
Field | Type | Description | Nullable | Relationship |
---|---|---|---|---|
name | String | The display name of the attachment | Yes | None |
href | String | The URL or path to the attachment | Yes | None |
Relationships
The Attachment
type does not have direct relationships to other object types. It is typically used as a nested object within other types, such as a product, to represent associated files or links.
Usage Examples
Basic Query
{
attachment {
name
href
}
}
Field Selection
{
attachment {
name
}
}
{
attachment {
href
}
}
Nested Queries
Assuming Attachment
is a field on a Product
type:
{
product(id: 12345) {
id
title
attachment {
name
href
}
}
}
Filtering and Sorting
The Attachment
type itself does not support filtering or sorting as it only contains scalar fields and is typically nested within other types. Filtering and sorting should be applied on the parent type (e.g., Product).
Implements
The Attachment
type does not implement any interfaces.
Connections
The Attachment
type does not have connection fields.
Related Types
- Product (commonly contains
Attachment
as a nested field)
Best Practices
- Use the
name
field to provide a human-readable label for the attachment. - Use the
href
field to store a fully qualified URL or relative path to the file or link. - When querying attachments, select only the fields you need to optimize response size.
- Since attachments are often nested, consider querying them only when necessary to reduce payload.
Notes
- Both
name
andhref
fields are optional and may be null if no attachment data is available. - The API currently requires no authentication, but this may change in future versions.
- Attachments are static references; no computed or derived fields are defined on this type.
- There are no field arguments on
Attachment
. - Performance considerations generally depend on the parent object; querying attachments alone is lightweight.
- Cache attachment URLs and names on the client side when possible to reduce repeated network requests.
Last updated on