System fields

All default, and custom content types come with some managed system fields. These fields reflect certain states of your content, such as when it was last updated, or published at.

Default model fieldsAnchor

These fields are included with all content models you create within Hygraph.

FieldTypeDescription
idID!Unique for each content entry
createdAtDateTime!Timestamp for when the content entry was created
createdByUserThe user who created the content entry
updatedAtDateTime!Timestamp for when the content entry was updated
updatedByUserThe user who last updated the content entry
publishedAtDateTime!Timestamp for when the content entry was published
publishedByUserThe user who last published the content entry
documentInStages[model]Query the current document in other stages

User fieldsAnchor

Since the User model is included with every project, it also comes with some predefined fields, as well as all of the system fields above (but not createdBy, updatedBy, and publishedBy).

The User model is part of "user attribution", and is connected with content entries. This connection allows you to see who created, updated, and published content entries.

FieldTypeDescription
idID!The ID of the user
nameString!The name of the user
pictureStringThe profile picture URL
kindUserKind!The type of user - either MEMBER, PAT, or PUBLIC
createdAtDateTime!The created at date and time of the user
updatedAtDateTime!The last updated at date and time of the user
publishedAtDateTimeThe last published at date and time of the user

All users will currently be members of your project. In the future they can be external users, part of a user authentication API.

Asset fieldsAnchor

Since the Asset model is included with every project, it also comes with some predefined fields, as well as all of the system fields above.

The Asset field type has all of the default model fields, as well as:

FieldTypeDescription
urlString!The URL of the asset, with any transformations.
handleString!The file handle.
fileNameString!The document file name that was uploaded.
heightFloatThe height of the file (for images only).
widthFloatThe width of the file (for images only).
sizeFloatThe total file size.
mimeTypeStringThe mime type of the file.
localeLocale!The system locale enumeration for your projects locales. E.g. en, de.
localizations[Asset!]!An array of localized assets for the asset you are querying.

Asset fields are localized by default, and always include the localization fields described below.

Pro Tip

While the Assets model is a system model that comes with every project by default and contains some predefined fields, you can still edit it to add fields for things like alt text and captions to your image assets.

Click here to learn more about adding fields to a model.

Localization fieldsAnchor

When you localize fields within Hygraph, the model will be updated to contain the following fields:

FieldTypeDescription
localeLocale!The system locale enumeration for your projects locales. E.g. en, de.
localizations[modelName!]!An array of localized entries for the model you are querying.

Learn more about working with Localization.

Version history fieldsAnchor

One of the auto-generated queries Hygraph will create is around versioning. Each time you publish content to a stage, a version is saved.

You can fetch the version history of a content entry by using the history field on a model. This field is managed automatically by Hygraph.

FieldTypeDescription
idID!The id of the content entry you are querying.
stageStage!The content stage the content entry was published to. E.g. PUBLISHED.
revisionInt!The revision number. Auto incrementing from 1.
createdAtDateTime!The timestamp when the version was created.

Connection type fieldsAnchor

Since Hygraph implements the Relay specification, when fetching with Relay you will have some fields made available to you automatically.

For example, let's imagine we have the model Post. The postsConnection would look a little something like:

FieldTypeDescription
edges[PostEdge!]!A list of edges, containing cursor, and the node.
pageInfoPageInfo!Information used for paginating nodes.
aggregateAggregate!The count of records, relative to any filters.

[PostEdge!]!Anchor

FieldTypeDescription
cursorString!The edge cursor, used for paginating records.
nodePost!The actual entry of the record, for example the Post entry.

PageInfo!Anchor

Hygraph exposes the PageInfo type on the field pageInfo for connection queries. This is useful with cursor based pagination.

FieldTypeDescription
hasNextPageBoolean!When paginating forwards, are there more items?
hasPreviousPageBoolean!When paginating backwards, are there more items?
startCursorStringWhen paginating backwards, the cursor to continue
endCursorStringWhen paginating forwards, the cursor to continue
pageSizeIntThe number of items in the current page

Learn more about Relay cursor pagination.

Aggregate!Anchor

It is possible using the connection type query to perform an aggregate count.

FieldTypeDescription
countInt!The count of results matching the query, and filters.