Custom scalars

Scalars are primitive values such as Int or String. GraphQL queries and responses take the form of a hierarchical tree; the leaves on these trees are GraphQL scalars. For more information, see the GraphQL spec.

Scalar Definition
Boolean

Represents true or false values.

DateTime

An ISO-8601 encoded UTC date time string. Example value: "2019-07-03T20:47:55Z".

Decimal

A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: "29.99".

Float

Represents signed double-precision fractional values as specified by IEEE 754.

HTML

A string containing HTML code. Example value: "<p>Grey cotton knit sweater.</p>".

ID

Represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Admin API example value: "gid://shopify/Product/10079785100".

Storefront API example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

Int

Represents non-fractional signed whole numeric values. Int can represent values between -(231) and 231 - 1.

Money

A monetary value string. Example value: "100.57".

String

Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

URL

An RFC 3986 and RFC 3987 compliant URI string.

Example value: "https://johns-apparel.myshopify.com".

Scalar Definition
Boolean

Represents true or false values.

DateTime

An ISO-8601 encoded UTC date time string. Example value: "2019-07-03T20:47:55Z".

Decimal

A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: "29.99".

Float

Represents signed double-precision fractional values as specified by IEEE 754.

HTML

A string containing HTML code. Example value: "<p>Grey cotton knit sweater.</p>".

ID

Represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Admin API example value: "gid://shopify/Product/10079785100".

Storefront API example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

Int

Represents non-fractional signed whole numeric values. Int can represent values between -(231) and 231 - 1.

Money

A monetary value string. Example value: "100.57".

String

Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

URL

An RFC 3986 and RFC 3987 compliant URI string.

Example value: "https://johns-apparel.myshopify.com".

Scalar Definition
Boolean

Represents true or false values.

DateTime

An ISO-8601 encoded UTC date time string. Example value: "2019-07-03T20:47:55Z".

Decimal

A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: "29.99".

Float

Represents signed double-precision fractional values as specified by IEEE 754.

HTML

A string containing HTML code. Example value: "<p>Grey cotton knit sweater.</p>".

ID

Represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Admin API example value: "gid://shopify/Product/10079785100".

Storefront API example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

Int

Represents non-fractional signed whole numeric values. Int can represent values between -(231) and 231 - 1.

Money

A monetary value string. Example value: "100.57".

String

Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

URL

An RFC 3986 and RFC 3987 compliant URI string.

Example value: "https://johns-apparel.myshopify.com".

Sign up for a Partner account to get started.

Sign up