We just launched our new Hygraph Studio in beta. Learn more

Hygraph
Docs

Assets API reference

#Overview

The Asset model is included with every project, can be modified with custom Field Types, and are localized by default, but cannot be deleted.

While most commonly used for photos, can support any file type including audio files, zip files, and more.

The Asset type extends the system fields.

Here are some links that might help you:

Document nameDescription
Fetching assetsLearn about the 4 query types that Hygraph automatically creates for every asset.
Referencing assetsLearn how to query assets in relation to a model in your schema.
TransformationsLearn about asset transformations.
Uploading assetsLearn how to upload assets by file and by remote URL.
Updating assetsLearn how to use the updateAsset mutation.
Deleting assetsLearn how to delete assets using the deleteAsset mutation.
Publishing assetsLearn how to use the publishAsset and unpublishAsset mutations.
Localized assetsLearn about asset localization.
Embedded typesLearn how to ember assets into Rich Text fields.

#Which asset system does my project use?

At the moment, Hygraph projects can use one of two asset systems. Projects created after February 2024 will use the new Hygraph Asset Management system, while projects that are older than that will use the Legacy asset system.

To learn what system your project uses, check the asset upload popup in the UI.

UI asset uploadUI asset upload

If your project shows this, you are using the legacy asset system:

UI - Legacy Asset systemUI - Legacy Asset system

If your project shows this, you are using the Hygraph Asset Management system:

UI - Hygraph Asset Management systemUI - Hygraph Asset Management system

Another way to quickly see which asset system your project uses is to navigate to Project Settings > Endpoints, and look for the Assets section.

If you see this, your project uses the new Hygraph Asset Management system:

Hygraph Asset Management systemHygraph Asset Management system

If you see this, your project uses the Legacy Asset system:

Legacy Asset systemLegacy Asset system