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.

Version 2020-01 (Release candidate)

Scalar Definition
Boolean

Represents true or false values.

Date

An ISO-8601 encoded UTC date string. Example value: "2019-07-16T16:00:00-04:00".

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.

FormattedString

A string containing a strict subset of HTML code. Non-allowed tags will be stripped out. Allowed tags:

  • a (allowed attributes: href)
  • b
  • br
  • em
  • i
  • strong
  • u

Example value: "Your current domain is <strong>johns-apparel.myshopify.com</strong>."

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.

JSON

A JSON Object. Example value: { "key1": "Value 1", "key2": "Value 2", "key3": 3 }

LiquidHTML

A string containing Liquid markup to be rendered as HTML. Example value: "<p></p>"

Money

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

StorefrontID

Represents a unique identifier in the Storefront API. A StorefrontID value can be used wherever an ID is expected in the Storefront API.

Example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

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".

UnsignedInt64

An unsigned 64-bit integer. Represents whole numeric values between 0 and 264 - 1 encoded as a string of base-10 digits.

Example value: "50".

UtcOffset

Time between UTC time and a location's observed time, in the format "+HH:MM" or "-HH:MM".

Example value: "-07:00".

Version 2019-10 (Latest)

Scalar Definition
Boolean

Represents true or false values.

Date

An ISO-8601 encoded UTC date string. Example value: "2019-07-16T16:00:00-04:00".

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.

FormattedString

A string containing a strict subset of HTML code. Non-allowed tags will be stripped out. Allowed tags:

  • a (allowed attributes: href)
  • b
  • br
  • em
  • i
  • strong
  • u

Example value: "Your current domain is <strong>johns-apparel.myshopify.com</strong>."

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.

JSON

A JSON Object. Example value: { "key1": "Value 1", "key2": "Value 2", "key3": 3 }

LiquidHTML

A string containing Liquid markup to be rendered as HTML. Example value: "<p></p>"

Money

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

StorefrontID

Represents a unique identifier in the Storefront API. A StorefrontID value can be used wherever an ID is expected in the Storefront API.

Example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

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".

UnsignedInt64

An unsigned 64-bit integer. Represents whole numeric values between 0 and 264 - 1 encoded as a string of base-10 digits.

Example value: "50".

UtcOffset

Time between UTC time and a location's observed time, in the format "+HH:MM" or "-HH:MM".

Example value: "-07:00".

Version 2019-07

Scalar Definition
Boolean

Represents true or false values.

Date

An ISO-8601 encoded UTC date string. Example value: "2019-07-16T16:00:00-04:00".

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.

FormattedString

A string containing a strict subset of HTML code. Non-allowed tags will be stripped out. Allowed tags:

  • a (allowed attributes: href)
  • b
  • br
  • em
  • i
  • strong
  • u

Example value: "Your current domain is <strong>johns-apparel.myshopify.com</strong>."

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.

JSON

A JSON Object. Example value: { "key1": "Value 1", "key2": "Value 2", "key3": 3 }

LiquidHTML

A string containing Liquid markup to be rendered as HTML. Example value: "<p></p>"

Money

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

StorefrontID

Represents a unique identifier in the Storefront API. A StorefrontID value can be used wherever an ID is expected in the Storefront API.

Example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

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".

UnsignedInt64

An unsigned 64-bit integer. Represents whole numeric values between 0 and 264 - 1 encoded as a string of base-10 digits.

Example value: "50".

UtcOffset

Time between UTC time and a location's observed time, in the format "+HH:MM" or "-HH:MM".

Example value: "-07:00".

Version 2019-04

Scalar Definition
Boolean

Represents true or false values.

Date

An ISO-8601 encoded UTC date string. Example value: "2019-07-16T16:00:00-04:00".

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.

FormattedString

A string containing a strict subset of HTML code. Non-allowed tags will be stripped out. Allowed tags:

  • a (allowed attributes: href)
  • b
  • br
  • em
  • i
  • strong
  • u

Example value: "Your current domain is <strong>johns-apparel.myshopify.com</strong>."

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.

JSON

A JSON Object. Example value: { "key1": "Value 1", "key2": "Value 2", "key3": 3 }

LiquidHTML

A string containing Liquid markup to be rendered as HTML. Example value: "<p></p>"

Money

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

StorefrontID

Represents a unique identifier in the Storefront API. A StorefrontID value can be used wherever an ID is expected in the Storefront API.

Example value: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw".

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".

UnsignedInt64

An unsigned 64-bit integer. Represents whole numeric values between 0 and 264 - 1 encoded as a string of base-10 digits.

Example value: "50".

UtcOffset

Time between UTC time and a location's observed time, in the format "+HH:MM" or "-HH:MM".

Example value: "-07:00".

Sign up for a Partner account to get started.

Sign up