This reference doc is generated based on this example 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 mutations
based on them.
Developer Defined Plus Data Connect Generated
type MainTable
🔨 MainTable is an example of developer defined table type to demonstrate various supported column types in a Postgres table.
type MainTable @table {
  uuidField: UUID
  stringField: String
  intField: Int
  int64Field: Int64
  floatField: Float
  booleanField: Boolean
  dateField: Date
  timestampField: Timestamp
  anyField: Any
  vectorField: Vector @col(size: 768)
}
@table(key) defines the primary key. If not configured otherwise, uses the
primary key field id. If the id field isn't present already, Data Connect
implicitly 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 as uuidtype. | 
| stringField | String | 🔨 stringField is an example of developer defined column as texttype. | 
| intField | Int | 🔨 intField is an example of developer defined column as inttype. | 
| int64Field | Int64 | 🔨 int64Field is an example of developer defined column as biginttype. | 
| floatField | Float | 🔨 floatField is an example of developer defined column as double precisiontype. | 
| booleanField | Boolean | 🔨 booleanField is an example of developer defined column as booleantype. | 
| dateField | Date | 🔨 dateField is an example of developer defined column as datetype. | 
| timestampField | Timestamp | 🔨 timestampField is an example of developer defined column as timestamptztype. | 
| anyField | Any | 🔨 anyField is an example of developer defined column as jsonbtype. | 
| vectorField | Vector | 🔨 vectorField is an example of developer defined column as pgvectortype.@col(size: 768)defines its length to work withgoogle_ml_integrationPostgres extensions in your Cloud SQL someFieldbase. | 
| uuidArray | [UUID] | 🔨 uuidArray is an example of developer defined column as uuid[]array type. | 
| stringArray | [String] | 🔨 stringArray is an example of developer defined column as text[]array type. | 
| intArray | [Int] | 🔨 intArray is an example of developer defined column as int[]array type. | 
| int64Array | [Int64] | 🔨 int64Array is an example of developer defined column as bigint[]array type. | 
| floatArray | [Float] | 🔨 floatArray is an example of developer defined column as double precision[]array type. | 
| booleanArray | [Boolean] | 🔨 booleanArray is an example of developer defined column as boolean[]array type. | 
| dateArray | [Date] | 🔨 dateArray is an example of developer defined column as date[]array type. | 
| timestampArray | [Timestamp] | 🔨 timestampArray is an example of developer defined column as timestamptz[]array type. | 
| anyArray | [Any] | 🔨 anyArray is an example of developer defined column as jsonb[]array type. | 
| id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See @tablefor how to customize it. | 
| oneToOneExample_on_main | OneToOneExample | ✨ List OneToOneExampleobjects in a one-to-one relationship (whereOneToOneExample.mainis this object). | 
| manyToManyJoinTables_on_left | [ManyToManyJoinTable!]! | ✨ List ManyToManyJoinTableobjects in a one-to-many relationship (whereManyToManyJoinTable.leftis this object). | 
| manyToManyJoinTables_on_right | [ManyToManyJoinTable!]! | ✨ List ManyToManyJoinTableobjects in a one-to-many relationship (whereManyToManyJoinTable.rightis this object). | 
| mainTables_via_ManyToManyJoinTable_on_right | [MainTable!]! | ✨ List MainTableobjects usingManyToManyJoinTableas the join table (aManyToManyJoinTableobject exists where itsleftis this and itsrightis that). | 
| mainTables_via_ManyToManyJoinTable_on_left | [MainTable!]! | ✨ List MainTableobjects usingManyToManyJoinTableas the join table (aManyToManyJoinTableobject exists where itsrightis this and itsleftis that). | 
| manyToOneExamples_on_main | [ManyToOneExample!]! | ✨ List ManyToOneExampleobjects in a one-to-many relationship (whereManyToOneExample.mainis this object). | 
| _metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. | 
| _count | Int! | ✨ Count the number of rows in the MainTabletable. | 
| stringField_count | Int! | ✨ Count the number of rows in the MainTabletable where thestringFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| booleanField_count | Int! | ✨ Count the number of rows in the MainTabletable where thebooleanFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| id_count | Int! | ✨ Count the number of rows in the MainTabletable where theidfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| timestampField_count | Int! | ✨ Count the number of rows in the MainTabletable where thetimestampFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| timestampField_max | Timestamp | ✨ Maximum of the timestampFieldfield in theMainTabletable. | 
| timestampField_min | Timestamp | ✨ Minimum of the timestampFieldfield in theMainTabletable. | 
| uuidField_count | Int! | ✨ Count the number of rows in the MainTabletable where theuuidFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| floatField_count | Int! | ✨ Count the number of rows in the MainTabletable where thefloatFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| floatField_max | Float | ✨ Maximum of the floatFieldfield in theMainTabletable. | 
| floatField_min | Float | ✨ Minimum of the floatFieldfield in theMainTabletable. | 
| floatField_sum | Float | ✨ Sum the floatFieldfield in theMainTabletable. | 
| floatField_avg | Float | ✨ Average the floatFieldfield in theMainTabletable. | 
| int64Field_count | Int! | ✨ Count the number of rows in the MainTabletable where theint64Fieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| int64Field_max | Int64 | ✨ Maximum of the int64Fieldfield in theMainTabletable. | 
| int64Field_min | Int64 | ✨ Minimum of the int64Fieldfield in theMainTabletable. | 
| int64Field_sum | Int64 | ✨ Sum the int64Fieldfield in theMainTabletable. | 
| int64Field_avg | Float | ✨ Average the int64Fieldfield in theMainTabletable. | 
| intField_count | Int! | ✨ Count the number of rows in the MainTabletable where theintFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| intField_max | Int | ✨ Maximum of the intFieldfield in theMainTabletable. | 
| intField_min | Int | ✨ Minimum of the intFieldfield in theMainTabletable. | 
| intField_sum | Int | ✨ Sum the intFieldfield in theMainTabletable. | 
| intField_avg | Float | ✨ Average the intFieldfield in theMainTabletable. | 
| dateField_count | Int! | ✨ Count the number of rows in the MainTabletable where thedateFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| dateField_max | Date | ✨ Maximum of the dateFieldfield in theMainTabletable. | 
| dateField_min | Date | ✨ Minimum of the dateFieldfield in theMainTabletable. | 
| anyField_count | Int! | ✨ Count the number of rows in the MainTabletable where theanyFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| anyField_max | Any | ✨ Maximum of the anyFieldfield in theMainTabletable. | 
| anyField_min | Any | ✨ Minimum of the anyFieldfield in theMainTabletable. | 
| vectorField_count | Int! | ✨ Count the number of rows in the MainTabletable where thevectorFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
type ManyToManyJoinTable
🔨 ManyToManyJoinTable is an example of developer defined join table that
establishes a many-to-many relationship between MainTable and itself.
type MainTable @table {
  someField: Any
}
type ManyToManyJoinTable @table(key: ["left", "right"]) {
  left: MainTable!
  right: MainTable!
}
NOTE: it's primary key are two columns with foreign key constraints to both
sides of the many-to-many relationship. The primary key constraint ensures that
for any given pair of MainTable rows, there is only one matching row in
ManyToManyJoinTable.
| Field | Type | Description | 
|---|---|---|
| left | MainTable! | 🔨 left is an example of developer defined foriegn key constraint to the MainTable!. It's part of primary key columns pair ofManyToManyJoinTable. | 
| right | MainTable! | 🔨 right is an example of developer defined foriegn key constraint to the MainTable!. It's part of primary key columns pair ofManyToManyJoinTable. | 
| leftId | UUID! | ✨ Implicit foreign key field based on ManyToManyJoinTable.left. It must match the value ofMainTable.id. See@reffor how to customize it. | 
| rightId | UUID! | ✨ Implicit foreign key field based on ManyToManyJoinTable.right. It must match the value ofMainTable.id. See@reffor how to customize it. | 
| _metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. | 
| _count | Int! | ✨ Count the number of rows in the ManyToManyJoinTabletable. | 
| leftId_count | Int! | ✨ Count the number of rows in the ManyToManyJoinTabletable where theleftIdfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| rightId_count | Int! | ✨ Count the number of rows in the ManyToManyJoinTabletable where therightIdfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
type ManyToOneExample
🔨 ManyToOneExample is an example of developer defined table type to demonstrates
an one-to-many relationship between MainTable and ManyToOneExample.
type MainTable @table {
  someField: Any
}
type ManyToOneExample @table {
  main: MainTable!
  someField: Any
}
| Field | Type | Description | 
|---|---|---|
| main | MainTable! | 🔨 main is an example of developer defined foriegn key constraint to the MainTable!. Each row ofManyToOneExamplehas exactly one corresponding row inMainTable. Each row ofMainTablecan 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 @tablefor how to customize it. | 
| mainId | UUID! | ✨ Implicit foreign key field based on ManyToOneExample.main. It must match the value ofMainTable.id. See@reffor how to customize it. | 
| _metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. | 
| _count | Int! | ✨ Count the number of rows in the ManyToOneExampletable. | 
| someField_count | Int! | ✨ Count the number of rows in the ManyToOneExampletable where thesomeFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| someField_max | Any | ✨ Maximum of the someFieldfield in theManyToOneExampletable. | 
| someField_min | Any | ✨ Minimum of the someFieldfield in theManyToOneExampletable. | 
| id_count | Int! | ✨ Count the number of rows in the ManyToOneExampletable where theidfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| mainId_count | Int! | ✨ Count the number of rows in the ManyToOneExampletable where themainIdfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
type OneToOneExample
🔨 OneToOneExample is an example of developer defined table type to demonstrate
an one-to-maybe relationship between MainTable and OneToOneExample.
type MainTable @table {
  someField: Any
}
type OneToOneExample @table {
  main: MainTable! @unique
  someField: Any
}
| Field | Type | Description | 
|---|---|---|
| main | MainTable! | 🔨 main is an example of developer defined foriegn key constraint to the MainTable!. The column also has a SQL unique constraint, which makes it a one-to-one relationship.  Each row ofOneToOneExamplehas exactly one corresponding row inMainTable. Each row ofMainTablecan 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 @tablefor how to customize it. | 
| mainId | UUID! | ✨ Implicit foreign key field based on OneToOneExample.main. It must match the value ofMainTable.id. See@reffor how to customize it. | 
| _metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. | 
| _count | Int! | ✨ Count the number of rows in the OneToOneExampletable. | 
| mainId_count | Int! | ✨ Count the number of rows in the OneToOneExampletable where themainIdfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| someField_count | Int! | ✨ Count the number of rows in the OneToOneExampletable where thesomeFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| someField_max | Any | ✨ Maximum of the someFieldfield in theOneToOneExampletable. | 
| someField_min | Any | ✨ Minimum of the someFieldfield in theOneToOneExampletable. | 
| id_count | Int! | ✨ Count the number of rows in the OneToOneExampletable where theidfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
type StringTable
🔨 StringTable is an example of developer defined table type to demonstrate array and non-null columns in a Postgres table.
type StringTable @table {
  stringField: String
  nonNullStringField: String!
  stringArray: [String]
  nonNullStringArray: [String!]
  stringNonnullArray: [String]!
  nonNullStringNonnullArray: [String!]!
}
| Field | Type | Description | 
|---|---|---|
| stringField | String | 🔨 stringField is an example of developer defined column as texttype. | 
| nonNullStringField | String! | 🔨 nonNullStringField is an example of developer defined column as texttype. Since it cannot be null, Data Connect automatically adds aNOT NULLconstraint to the column. | 
| stringArray | [String] | 🔨 stringArray is an example of developer defined column as text[]array type.  Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringArrayandnonNullStringArrayare equivalent. | 
| nonNullStringArray | [String!] | 🔨 nonNullStringArray is an example of developer defined column as text[]array type.  Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringArrayandnonNullStringArrayare equivalent. | 
| stringNonnullArray | [String]! | 🔨 nonNullStringNonnullArray is an example of developer defined column as text[]array type. Since it cannot be null, Data Connect automatically adds aNOT NULLconstraint to the column.  Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringNonnullArrayandnonNullStringNonnullArrayare equivalent. | 
| nonNullStringNonnullArray | [String!]! | 🔨 nonNullStringNonnullArray is an example of developer defined column as text[]array type. Since it cannot be null, Data Connect automatically adds aNOT NULLconstraint to the column.  Data Connect doesn't support sparse array. Backend drops any null elements in the array before returning the result.stringNonnullArrayandnonNullStringNonnullArrayare equivalent. | 
| id | UUID! | ✨ Implicit primary key field. It's a UUID column default to a generated new value. See @tablefor how to customize it. | 
| _metadata | _Metadata | Implicit metadata field that cannot be written. It provides extra information about query results. | 
| _count | Int! | ✨ Count the number of rows in the StringTabletable. | 
| stringField_count | Int! | ✨ Count the number of rows in the StringTabletable where thestringFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| nonNullStringField_count | Int! | ✨ Count the number of rows in the StringTabletable where thenonNullStringFieldfield is non-null. Pass thedistinctargument to instead count the number of distinct values. | 
| id_count | Int! | ✨ Count the number of rows in the StringTabletable where theidfield is non-null. Pass thedistinctargument 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 optional specifiedByURL, 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 |