Scalar Types

This reference doc is generated based on thisexample schema.

Scalar types define the basic data types used for individual fields or arguments in a GraphQL schema.

Data Connect supports GraphQL's built in scalar types and a few additional scalars.Customer defined scalar types are not supported.

Data Connect Defined

scalar Any

Specification:https://www.json.org/json-en.html

TheAny scalar type accommodates any validJSON value(e.g., numbers, strings, booleans, arrays, objects). PostgreSQL efficientlystores this data as jsonb, providing flexibility for schemas with evolving structures.

Caution: JSON doesn't distinguish Int and Float.
Example:

Schema

typeMovie@table{name:String!metadata:Any!}

Mutation

Insert a movie with name and metadata from JSON literal.

mutationInsertMovie{movie_insert(data:{name:"The Dark Knight"metadata:{release_year:2008genre:["Action","Adventure","Superhero"]cast:[{name:"Christopher Bale",age:31}{name:"Heath Ledger",age:28}]director:"Christopher Nolan"}})}

Insert a movie with name and metadata that's constructed from a few GQL variables.

mutationInsertMovie($name:String!,$releaseDate:Date!,$genre:[String],$cast:[Any],$director:String!,$boxOfficeInUSD:Int){movie_insert(data:{name:$name,release_date:$releaseDate,genre:$genre,cast:$cast,director:$director,box_office:$boxOfficeInUSD})}

Note:

Query

Sincemetadata field has scalarAny type, it would return the full JSON in the response.

Note: You can't define selection set to scalar based onGraphQL spec.

queryGetAllMovies{movies{namemetadata}}

scalar Any_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression whose return type is valid JSON.

Examples: -{'A' : 'B'} (Evaluates to a JSON object.) -['A', 'B'] (Evaluates to a JSON array.) -{'A' 1, 'B': [1, 2, {'foo': 'bar'}]} (Nested JSON objects and arrays.)

scalar Any_SQL

Specification:https://www.postgresql.org/docs/current/sql-expressions.html

A PostgreSQL value expression whose return type is unspecified.

scalar Boolean_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a boolean at runtime.

This expression can reference theauth variable, which is null when FirebaseAuth is not used. When Firebase Auth is used, the following fields are available:

  • auth.uid: The current user ID.
  • auth.token: A map containing all token fields (e.g., claims).
ExampleDescription
auth != nullAllow only if a Firebase Auth user is present.

scalar Date

Specification:https://scalars.graphql.org/andimarek/local-date.html

Date is a string in the YYYY-MM-DD format representing a local-only date.

See the description for Timestamp for range and limitations.

As a FDC-specific extension, inputs that includes time portions (as specified bythe Timestamp scalar) are accepted but only the date portion is used. In otherwords, only the part before "T" is used and the rest discarded. This effectivelytruncates it to the local date in the specified time-zone.

Outputs will always be in the canonical YYYY-MM-DD format.

In the PostgreSQL table, it's stored asdate.

scalar Date_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a Timestamp at runtime,which is then truncated to UTC date only. The time-of-day parts are discarded.

Limitation: Right now, only a few expressions are supported.

ExampleDescription
request.timeThe UTC date on which the request is received.

scalar Float_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a Float at runtime.

ExampleDescription
2.0 * 4.0Evaluates to 8.0.

scalar Int64

Int64 is a scalar that represents a 64-bit signed integer.

In the PostgreSQL table, it's stored asbigint.

On the wire, it's encoded as string because 64-bit integer exceeds the range of JSON number.

scalar Int64_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a Int64 at runtime.

ExampleDescription
5000*1000*1000Evaluates to 5e9.

scalar Int_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a Int at runtime.

ExampleDescription
2 * 4Evaluates to 8.
vars.foo.size()Assumingvars.foo is a string, it will evaluate to the length of the string.

scalar String_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a string at runtime.

Limitation: Currently, only a limited set of expressions are supported.

ExampleDescription
auth.uidThe ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)
uuidV4()Generates a new random UUID (version 4) string, formatted as 32 lower-case hex digits without delimiters.

scalar Timestamp

Specification:https://scalars.graphql.org/andimarek/date-time

Timestamp is a RFC 3339 string that represents an exact point in time.

The serialization format follows https://scalars.graphql.org/andimarek/date-timeexcept the "Non-optional exact milliseconds" Section. As a FDC-specificextension, inputs and outputs may contain 0, 3, 6, or 9 fractional digits.

Specifically, output precision varies by server-side factors such as data sourcesupport and clients must not rely on an exact number of digits. Clients maytruncate extra digits as fit, with the caveat that there may be information lossif the truncated value is subsequently sent back to the server.

FDC only supports year 1583 to 9999 (inclusive) and uses the ISO-8601 calendarsystem for all date-time calculations. Notably, the expanded year representation(+/-YYYYY) is rejected and Year 1582 and before may either be rejected or causeundefined behavior.

In the PostgreSQL table, it's stored astimestamptz.

scalar Timestamp_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a Timestamp at runtime.

Limitation: Right now, only a few expressions are supported.

ExampleDescription
request.timeThe timestamp when the request is received (with microseconds precision).

scalar True

TheTrue scalar type only accepts the boolean valuetrue.

An optional field/argument typed asTrue may either be settotrue or omitted (not provided at all). The valuesfalse ornull are notaccepted.

ExampleDescription
trueThe only allowed value.

scalar UUID

Specification:https://tools.ietf.org/html/rfc4122

UUID is a string of hexadecimal digits representing an RFC4122-compliant UUID.

UUIDs are always output as 32 lowercase hexadecimal digits without delimiters orcurly braces.Inputs in the following formats are also accepted (case insensitive):

  • xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

In the PostgreSQL table, it's stored asuuid.

scalar UUID_Expr

Specification:https://github.com/google/cel-spec

A Common Expression Language (CEL) expression that returns a UUID string at runtime.

Limitation: Currently, only a limited set of expressions are supported.

ExampleDescription
uuidV4()Generates a new random UUID (version 4) every time.

scalar Vector

Vector is an array of single-precision floating-point numbers, serializedas a JSON array. All elements must be finite (no NaN, Infinity or -Infinity).

Example: [1.1, 2, 3.3]

In the PostgreSQL table, it's stored aspgvector.

SeeVector_Embed for how to generate text embeddings in query and mutations.

scalar Vector_Embed_Model

Specification:https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versioning

The Vertex AI model version that is required in inputVector_Embed.

It is recommended to use the latest stable model version:textembedding-gecko@003.

View all supportedVertex AI Text embeddings APIs.

ExampleDescription
textembedding-gecko@003A stable version of the textembedding-gecko model
textembedding-gecko@001An older version of the textembedding-gecko model
text-embedding-004Another text embedding model

scalar Void

TheVoid scalar type represents the absence of any value. It is typically usedin operations where no value is expected in return.

Data Connect Generated

scalar MainTable_KeyOutput

MainTable_KeyOutput returns the primary key fields of table typeMainTable.

It has the same format asMainTable_Key, but is only used as mutation return value.

scalar ManyToManyJoinTable_KeyOutput

ManyToManyJoinTable_KeyOutput returns the primary key fields of table typeManyToManyJoinTable.

It has the same format asManyToManyJoinTable_Key, but is only used as mutation return value.

scalar ManyToOneExample_KeyOutput

ManyToOneExample_KeyOutput returns the primary key fields of table typeManyToOneExample.

It has the same format asManyToOneExample_Key, but is only used as mutation return value.

scalar OneToOneExample_KeyOutput

OneToOneExample_KeyOutput returns the primary key fields of table typeOneToOneExample.

It has the same format asOneToOneExample_Key, but is only used as mutation return value.

scalar StringTable_KeyOutput

StringTable_KeyOutput returns the primary key fields of table typeStringTable.

It has the same format asStringTable_Key, but is only used as mutation return value.

Built In

scalar Boolean

TheBoolean scalar type representstrue orfalse.

scalar Float

TheFloat scalar type represents signed double-precision fractional values as specified byIEEE 754.

scalar ID

TheID scalar type 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; however, it is not intended to be human-readable. When expected as an input type, any string (such as"4") or integer (such as4) input value will be accepted as an ID.

scalar Int

TheInt scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

scalar String

TheString scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-21 UTC.