Object Types Stay organized with collections Save and categorize content based on your preferences.
This reference doc is generated based on thisexample schema.
Object types define a collection of fields representing an entity in a GraphQL schema.
Developer defines@table types and Data Connect generates queries and mutationsbased on them.
Developer Defined Plus Data Connect Generated
type MainTable
🔨 MainTable is an example of developer defined table type to demonstratevarious supported column types in a Postgres table.
typeMainTable@table{uuidField:UUIDstringField:String@searchableintField:Intint64Field:Int64floatField:FloatbooleanField:BooleandateField:DatetimestampField:TimestampanyField:AnyvectorField:Vector@col(size:768)}@table(key) defines the primary key. If not configured otherwise, uses theprimary key fieldid. If theid field isn't present already, Data Connectimplicitly adds an auto-generated UUID primary key field:id: UUID! @default(expr: "uuidV4()")
| Field | Type | Description |
|---|---|---|
uuidField | UUID | 🔨 uuidField is an example of developer defined column asuuid type. |
stringField | String | 🔨 stringField is an example of developer defined column astext type. Indexed for full-text search. |
intField | Int | 🔨 intField is an example of developer defined column asint type. |
int64Field | Int64 | 🔨 int64Field is an example of developer defined column asbigint type. |
floatField | Float | 🔨 floatField is an example of developer defined column asdouble precision type. |
booleanField | Boolean | 🔨 booleanField is an example of developer defined column asboolean type. |
dateField | Date | 🔨 dateField is an example of developer defined column asdate type. |
timestampField | Timestamp | 🔨 timestampField is an example of developer defined column astimestamptz type. |
anyField | Any | 🔨 anyField is an example of developer defined column asjsonb type. |
vectorField | Vector | 🔨 vectorField is an example of developer defined column aspgvector type.@col(size: 768) defines its length to work withgoogle_ml_integration Postgres extensions in your Cloud SQL someFieldbase. |
uuidArray | [UUID] | 🔨 uuidArray is an example of developer defined column asuuid[]array type. |
stringArray | [String] | 🔨 stringArray is an example of developer defined column astext[]array type. |
intArray | [Int] | 🔨 intArray is an example of developer defined column asint[]array type. |
int64Array | [Int64] | 🔨 int64Array is an example of developer defined column asbigint[]array type. |
floatArray | [Float] | 🔨 floatArray is an example of developer defined column asdouble precision[]array type. |
booleanArray | [Boolean] | 🔨 booleanArray is an example of developer defined column asboolean[]array type. |
dateArray | [Date] | 🔨 dateArray is an example of developer defined column asdate[]array type. |
timestampArray | [Timestamp] | 🔨 timestampArray is an example of developer defined column astimestamptz[]array type. |
anyArray | [Any] | 🔨 anyArray is an example of developer defined column asjsonb[]array type. |
id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See@table for how to customize it. |
_metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. |
__typename | String! | This is not a generated field, it models the builtin GraphQL field called __typename, which varies per table. |
_id | ID! | A generated field that is used for caching results in SDKs. |
_count | Int! | ✨ Count the number of rows in theMainTable table. |
id_count | Int! | ✨ Count the number of rows in theMainTable table where theid field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
anyField_count | Int! | ✨ Count the number of rows in theMainTable table where theanyField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
anyField_max | Any | ✨ Maximum of theanyField field in theMainTable table. |
anyField_min | Any | ✨ Minimum of theanyField field in theMainTable table. |
booleanField_count | Int! | ✨ Count the number of rows in theMainTable table where thebooleanField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
dateField_count | Int! | ✨ Count the number of rows in theMainTable table where thedateField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
dateField_max | Date | ✨ Maximum of thedateField field in theMainTable table. |
dateField_min | Date | ✨ Minimum of thedateField field in theMainTable table. |
floatField_count | Int! | ✨ Count the number of rows in theMainTable table where thefloatField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
floatField_max | Float | ✨ Maximum of thefloatField field in theMainTable table. |
floatField_min | Float | ✨ Minimum of thefloatField field in theMainTable table. |
floatField_sum | Float | ✨ Sum thefloatField field in theMainTable table. |
floatField_avg | Float | ✨ Average thefloatField field in theMainTable table. |
int64Field_count | Int! | ✨ Count the number of rows in theMainTable table where theint64Field field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
int64Field_max | Int64 | ✨ Maximum of theint64Field field in theMainTable table. |
int64Field_min | Int64 | ✨ Minimum of theint64Field field in theMainTable table. |
int64Field_sum | Int64 | ✨ Sum theint64Field field in theMainTable table. |
int64Field_avg | Float | ✨ Average theint64Field field in theMainTable table. |
intField_count | Int! | ✨ Count the number of rows in theMainTable table where theintField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
intField_max | Int | ✨ Maximum of theintField field in theMainTable table. |
intField_min | Int | ✨ Minimum of theintField field in theMainTable table. |
intField_sum | Int | ✨ Sum theintField field in theMainTable table. |
intField_avg | Float | ✨ Average theintField field in theMainTable table. |
stringField_count | Int! | ✨ Count the number of rows in theMainTable table where thestringField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
timestampField_count | Int! | ✨ Count the number of rows in theMainTable table where thetimestampField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
timestampField_max | Timestamp | ✨ Maximum of thetimestampField field in theMainTable table. |
timestampField_min | Timestamp | ✨ Minimum of thetimestampField field in theMainTable table. |
uuidField_count | Int! | ✨ Count the number of rows in theMainTable table where theuuidField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
vectorField_count | Int! | ✨ Count the number of rows in theMainTable table where thevectorField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
manyToManyJoinTables_on_left | [ManyToManyJoinTable!]! | ✨ ListManyToManyJoinTable objects in a one-to-many relationship (whereManyToManyJoinTable.left is this object). |
manyToManyJoinTables_on_right | [ManyToManyJoinTable!]! | ✨ ListManyToManyJoinTable objects in a one-to-many relationship (whereManyToManyJoinTable.right is this object). |
mainTables_via_ManyToManyJoinTable_on_right | [MainTable!]! | ✨ ListMainTable objects usingManyToManyJoinTable as the join table (aManyToManyJoinTable object exists where itsleft is this and itsright is that). |
mainTables_via_ManyToManyJoinTable_on_left | [MainTable!]! | ✨ ListMainTable objects usingManyToManyJoinTable as the join table (aManyToManyJoinTable object exists where itsright is this and itsleft is that). |
manyToOneExamples_on_main | [ManyToOneExample!]! | ✨ ListManyToOneExample objects in a one-to-many relationship (whereManyToOneExample.main is this object). |
oneToOneExample_on_main | OneToOneExample | ✨ ListOneToOneExample objects in a one-to-one relationship (whereOneToOneExample.main is this object). |
type ManyToManyJoinTable
🔨 ManyToManyJoinTable is an example of developer defined join table thatestablishes a many-to-many relationship betweenMainTable and itself.
typeMainTable@table{someField:Any}typeManyToManyJoinTable@table(key:["left","right"]){left:MainTable!right:MainTable!}NOTE: it's primary key are two columns with foreign key constraints to bothsides of the many-to-many relationship. The primary key constraint ensures thatfor any given pair ofMainTable rows, there is only one matching row inManyToManyJoinTable.
| Field | Type | Description |
|---|---|---|
left | MainTable! | 🔨 left is an example of developer defined foriegn key constraint to theMainTable!. It's part of primary key columns pair ofManyToManyJoinTable. |
right | MainTable! | 🔨 right is an example of developer defined foriegn key constraint to theMainTable!. It's part of primary key columns pair ofManyToManyJoinTable. |
leftId | UUID! | ✨ Implicit foreign key field based onManyToManyJoinTable.left. It must match the value ofMainTable.id. See@ref for how to customize it. |
rightId | UUID! | ✨ Implicit foreign key field based onManyToManyJoinTable.right. It must match the value ofMainTable.id. See@ref for how to customize it. |
_metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. |
__typename | String! | This is not a generated field, it models the builtin GraphQL field called __typename, which varies per table. |
_id | ID! | A generated field that is used for caching results in SDKs. |
_count | Int! | ✨ Count the number of rows in theManyToManyJoinTable table. |
leftId_count | Int! | ✨ Count the number of rows in theManyToManyJoinTable table where theleftId field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
rightId_count | Int! | ✨ Count the number of rows in theManyToManyJoinTable table where therightId field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
type ManyToOneExample
🔨 ManyToOneExample is an example of developer defined table type to demonstratesan one-to-many relationship betweenMainTable andManyToOneExample.
typeMainTable@table{someField:Any}typeManyToOneExample@table{main:MainTable!someField:Any}| Field | Type | Description |
|---|---|---|
main | MainTable! | 🔨 main is an example of developer defined foriegn key constraint to theMainTable!. Each row ofManyToOneExample has exactly one corresponding row inMainTable. Each row ofMainTable can be associated with multiple rows inManyToOneExample. |
someField | Any | |
id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See@table for how to customize it. |
mainId | UUID! | ✨ Implicit foreign key field based onManyToOneExample.main. It must match the value ofMainTable.id. See@ref for how to customize it. |
_metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. |
__typename | String! | This is not a generated field, it models the builtin GraphQL field called __typename, which varies per table. |
_id | ID! | A generated field that is used for caching results in SDKs. |
_count | Int! | ✨ Count the number of rows in theManyToOneExample table. |
id_count | Int! | ✨ Count the number of rows in theManyToOneExample table where theid field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
mainId_count | Int! | ✨ Count the number of rows in theManyToOneExample table where themainId field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
someField_count | Int! | ✨ Count the number of rows in theManyToOneExample table where thesomeField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
someField_max | Any | ✨ Maximum of thesomeField field in theManyToOneExample table. |
someField_min | Any | ✨ Minimum of thesomeField field in theManyToOneExample table. |
type OneToOneExample
🔨 OneToOneExample is an example of developer defined table type to demonstratean one-to-maybe relationship betweenMainTable andOneToOneExample.
typeMainTable@table{someField:Any}typeOneToOneExample@table{main:MainTable!@uniquesomeField:Any}| Field | Type | Description |
|---|---|---|
main | MainTable! | 🔨 main is an example of developer defined foriegn key constraint to theMainTable!. The column also has a SQL unique constraint, which makes it a one-to-one relationship. Each row ofOneToOneExample has exactly one corresponding row inMainTable. Each row ofMainTable can be associated with one or none row inOneToOneExample. |
someField | Any | |
id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See@table for how to customize it. |
mainId | UUID! | ✨ Implicit foreign key field based onOneToOneExample.main. It must match the value ofMainTable.id. See@ref for how to customize it. |
_metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. |
__typename | String! | This is not a generated field, it models the builtin GraphQL field called __typename, which varies per table. |
_id | ID! | A generated field that is used for caching results in SDKs. |
_count | Int! | ✨ Count the number of rows in theOneToOneExample table. |
id_count | Int! | ✨ Count the number of rows in theOneToOneExample table where theid field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
mainId_count | Int! | ✨ Count the number of rows in theOneToOneExample table where themainId field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
someField_count | Int! | ✨ Count the number of rows in theOneToOneExample table where thesomeField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
someField_max | Any | ✨ Maximum of thesomeField field in theOneToOneExample table. |
someField_min | Any | ✨ Minimum of thesomeField field in theOneToOneExample table. |
type StringTable
🔨 StringTable is an example of developer defined table type to demonstratearray and non-null columns in a Postgres table.
typeStringTable@table{stringField:StringnonNullStringField:String!stringArray:[String]nonNullStringArray:[String!]stringNonnullArray:[String]!nonNullStringNonnullArray:[String!]!}| Field | Type | Description |
|---|---|---|
stringField | String | 🔨 stringField is an example of developer defined column astext type. |
nonNullStringField | String! | 🔨 nonNullStringField is an example of developer defined column astext type. Since it cannot be null, Data Connect automatically adds aNOT NULL constraint to the column. |
stringArray | [String] | 🔨 stringArray is an example of developer defined column astext[]array type. Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringArray andnonNullStringArray are equivalent. |
nonNullStringArray | [String!] | 🔨 nonNullStringArray is an example of developer defined column astext[]array type. Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringArray andnonNullStringArray are equivalent. |
stringNonnullArray | [String]! | 🔨 nonNullStringNonnullArray is an example of developer defined column astext[]array type. Since it cannot be null, Data Connect automatically adds aNOT NULL constraint to the column. Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringNonnullArray andnonNullStringNonnullArray are equivalent. |
nonNullStringNonnullArray | [String!]! | 🔨 nonNullStringNonnullArray is an example of developer defined column astext[]array type. Since it cannot be null, Data Connect automatically adds aNOT NULL constraint to the column. Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringNonnullArray andnonNullStringNonnullArray are equivalent. |
id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See@table for how to customize it. |
_metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. |
__typename | String! | This is not a generated field, it models the builtin GraphQL field called __typename, which varies per table. |
_id | ID! | A generated field that is used for caching results in SDKs. |
_count | Int! | ✨ Count the number of rows in theStringTable table. |
id_count | Int! | ✨ Count the number of rows in theStringTable table where theid field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
nonNullStringField_count | Int! | ✨ Count the number of rows in theStringTable table where thenonNullStringField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
stringField_count | Int! | ✨ Count the number of rows in theStringTable table where thestringField field is non-null. Pass thedistinct argument to instead count the number of distinct values. |
Built In
type __Directive
A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String | |
locations | [__DirectiveLocation!]! | |
args | [__InputValue!]! | |
isRepeatable | Boolean! |
type __EnumValue
One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String | |
isDeprecated | Boolean! | |
deprecationReason | String |
type __Field
Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String | |
args | [__InputValue!]! | |
type | __Type! | |
isDeprecated | Boolean! | |
deprecationReason | String |
type __InputValue
Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.
| Field | Type | Description |
|---|---|---|
name | String! | |
description | String | |
type | __Type! | |
defaultValue | String | A GraphQL-formatted string representing the default value for this input value. |
isDeprecated | Boolean! | |
deprecationReason | String |
type __Schema
A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.
| Field | Type | Description |
|---|---|---|
description | String | |
types | [__Type!]! | A list of all types supported by this server. |
queryType | __Type! | The type that query operations will be rooted at. |
mutationType | __Type | If this server supports mutation, the type that mutation operations will be rooted at. |
subscriptionType | __Type | If this server support subscription, the type that subscription operations will be rooted at. |
directives | [__Directive!]! | A list of all directives supported by this server. |
type __Type
The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the__TypeKind enum.
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optionalspecifiedByURL, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.
| Field | Type | Description |
|---|---|---|
kind | __TypeKind! | |
name | String | |
description | String | |
fields | [__Field!] | |
interfaces | [__Type!] | |
possibleTypes | [__Type!] | |
enumValues | [__EnumValue!] | |
inputFields | [__InputValue!] | |
ofType | __Type | |
specifiedByURL | String |
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.