graphql-engine/v3/engine/tests/schema.json
Puru Gupta 048ddbd33d generate IR for type to command local relationships (#251)
Co-authored-by: Abhinav Gupta <abhinav@hasura.io>
V3_GIT_ORIGIN_REV_ID: b49b4c236c0df997ca8fcbe0a3e52e90f731f544
2024-01-08 10:40:54 +00:00

2666 lines
75 KiB
JSON

{
"version": "v2",
"subgraphs": [
{
"name": "default",
"objects": [
{
"definition": {
"name": "db",
"url": {
"singleUrl": {
"value": "http://postgres_connector:8100"
}
},
"headers": {
"hasura-m-auth-token": {
"value": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~!#$&'()*+,/:;=?@[]\""
}
},
"schema": {
"scalar_types": {
"varchar": {
"aggregate_functions": {},
"comparison_operators": {
"_neq": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_gt": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_gte": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_lt": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_lte": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_like": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_ilike": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_nlike": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_nilike": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_regex": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_iregex": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_nregex": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_niregex": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_similar": {
"argument_type": {
"type": "named",
"name": "varchar"
}
},
"_nsimilar": {
"argument_type": {
"type": "named",
"name": "varchar"
}
}
},
"update_operators": {}
},
"int4": {
"aggregate_functions": {
"min": {
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int4"
}
}
},
"max": {
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int4"
}
}
}
},
"comparison_operators": {
"_gt": {
"argument_type": {
"type": "named",
"name": "int4"
}
},
"_gte": {
"argument_type": {
"type": "named",
"name": "int4"
}
},
"_lt": {
"argument_type": {
"type": "named",
"name": "int4"
}
},
"_lte": {
"argument_type": {
"type": "named",
"name": "int4"
}
},
"_neq": {
"argument_type": {
"type": "named",
"name": "int4"
}
}
},
"update_operators": {}
},
"int8": {
"aggregate_functions": {
"min": {
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int8"
}
}
},
"max": {
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int8"
}
}
}
},
"comparison_operators": {
"_gt": {
"argument_type": {
"type": "named",
"name": "int8"
}
},
"_gte": {
"argument_type": {
"type": "named",
"name": "int8"
}
},
"_lt": {
"argument_type": {
"type": "named",
"name": "int8"
}
},
"_lte": {
"argument_type": {
"type": "named",
"name": "int8"
}
},
"_neq": {
"argument_type": {
"type": "named",
"name": "int8"
}
}
},
"update_operators": {}
}
},
"object_types": {
"article": {
"description": "An article",
"fields": {
"id": {
"description": "The article's primary key",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
},
"title": {
"description": "The article's title",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"author_id": {
"description": "The article's author ID",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
}
}
},
"author": {
"description": "An author",
"fields": {
"last_name": {
"description": "The author's last name",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"first_name": {
"description": "The author's first name",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"id": {
"description": "The author's primary key",
"arguments": {},
"type": {
"type": "named",
"name": "int8"
}
}
}
},
"test_nullable_and_array": {
"description": "Testing nullable and array types",
"fields": {
"nullable_field": {
"description": "Nullable types",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"non_nullable_field": {
"description": "Non-nullable types",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"array_field": {
"description": "Non-nullable array types [String!]!",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"nullable_array_field": {
"description": "Nullable array types [String!]",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"array_nullable_field": {
"description": "Array nullable types [String]!",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"nullable_array_nullable_field": {
"description": "Nullable array nullable types [String]",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
}
}
},
"Artist": {
"description": "An artist",
"fields": {
"ArtistId": {
"description": "The artist's primary key",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
},
"Name": {
"description": "The artist's name",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
}
}
},
"Album": {
"description": "An album",
"fields": {
"AlbumId": {
"description": "The album's primary key",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
},
"Title": {
"description": "The album's title",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"ArtistId": {
"description": "The album's artist ID",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
}
}
},
"Track": {
"description": "A track",
"fields": {
"TrackId": {
"description": "The track's primary key",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
},
"Name": {
"description": "The track's name",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
},
"AlbumId": {
"description": "The track's album ID",
"arguments": {},
"type": {
"type": "named",
"name": "int4"
}
}
}
},
"artist_below_id": {
"description": "An artist",
"fields": {
"ArtistId": {
"description": "The artist's primary key",
"arguments": {
"id": {
"description": "The cyling id",
"type": {
"type": "named",
"name": "int4"
}
}
},
"type": {
"type": "named",
"name": "int4"
}
},
"Name": {
"description": "The artist's name",
"arguments": {},
"type": {
"type": "named",
"name": "varchar"
}
}
}
}
},
"collections": [
{
"name": "articles",
"description": "A collection of articles",
"arguments": {},
"type": "article",
"deletable": false,
"uniqueness_constraints": {
"ArticleByID": {
"unique_columns": [
"id"
]
}
},
"foreign_keys": {}
},
{
"name": "authors",
"description": "A collection of authors",
"arguments": {},
"type": "author",
"deletable": false,
"uniqueness_constraints": {
"AuthorByID": {
"unique_columns": [
"id"
]
}
},
"foreign_keys": {}
},
{
"name": "articles_by_author",
"description": "Articles parameterized by author",
"arguments": {
"author_id": {
"type": {
"type": "named",
"name": "int4"
}
}
},
"type": "article",
"deletable": false,
"uniqueness_constraints": {},
"foreign_keys": {}
},
{
"name": "test_nullable_and_array_types",
"description": "Testing nullable and array types (input and output)",
"arguments": {
"nullable_field": {
"type": {
"type": "named",
"name": "varchar"
}
},
"non_nullable_field": {
"type": {
"type": "named",
"name": "varchar"
}
},
"array_field": {
"type": {
"type": "named",
"name": "varchar"
}
},
"nullable_array_field": {
"type": {
"type": "named",
"name": "varchar"
}
},
"array_nullable_field": {
"type": {
"type": "named",
"name": "varchar"
}
},
"nullable_array_nullable_field": {
"type": {
"type": "named",
"name": "varchar"
}
}
},
"type": "test_nullable_and_array",
"deletable": false,
"uniqueness_constraints": {},
"foreign_keys": {}
},
{
"name": "Artist",
"description": "A collection of artists",
"arguments": {},
"type": "Artist",
"deletable": false,
"uniqueness_constraints": {
"ArtistById": {
"unique_columns": [
"ArtistId"
]
}
},
"foreign_keys": {}
},
{
"name": "Album",
"description": "A collection of albums",
"arguments": {},
"type": "Album",
"deletable": false,
"uniqueness_constraints": {
"AlbumById": {
"unique_columns": [
"AlbumId"
]
}
},
"foreign_keys": {}
},
{
"name": "Track",
"description": "A collection of tracks",
"arguments": {},
"type": "Track",
"deletable": false,
"uniqueness_constraints": {
"TrackById": {
"unique_columns": [
"TrackId"
]
}
},
"foreign_keys": {}
},
{
"name": "artist_below_id",
"description": "A collection of artists below a certain id",
"arguments": {
"id": {
"description": "The ceiling id",
"type": {
"type": "named",
"name": "int4"
}
}
},
"type": "Artist",
"deletable": false,
"uniqueness_constraints": {},
"foreign_keys": {}
}
],
"functions": [
{
"name": "latest_article_id",
"description": "Get the ID of the most recent article",
"arguments": {},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "int4"
}
}
},
{
"name": "latest_article",
"description": "Get the most recent article",
"arguments": {},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "article"
}
}
},
{
"name": "get_article_by_id",
"description": "Get article based on ID",
"arguments": {
"id": {
"description": "the id of the article to fetch",
"type": {
"type": "named",
"name": "int4"
}
}
},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "article"
}
}
},
{
"name": "get_author_by_id",
"description": "Get artist based on id",
"arguments": {
"id": {
"description": "the id of the artist to fetch",
"type": {
"type": "named",
"name": "int4"
}
}
},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "author"
}
}
}
],
"procedures": [
{
"name": "upsert_article",
"description": "Insert or update an article",
"arguments": {
"article": {
"description": "The article to insert or update",
"type": {
"type": "named",
"name": "article"
}
}
},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "article"
}
}
},
{
"name": "update_article_title_by_id",
"description": "Update an article title given the ID and new title",
"arguments": {
"id": {
"description": "the id of the article to update",
"type": {
"type": "named",
"name": "int4"
}
},
"title": {
"description": "the new title of the article",
"type": {
"type": "named",
"name": "varchar"
}
}
},
"result_type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "article"
}
}
}
]
}
},
"version": "v2",
"kind": "DataConnector"
},
{
"definition": {
"name": "Artist",
"fields": [
{
"name": "ArtistId",
"type": "Int"
},
{
"name": "Name",
"type": "String"
}
],
"graphql": {
"typeName": "Artist"
}
},
"version": "v1",
"kind": "ObjectType"
},
{
"definition": {
"name": "Album",
"fields": [
{
"name": "AlbumId",
"type": "Int"
},
{
"name": "Title",
"type": "String"
},
{
"name": "ArtistId",
"type": "Int"
}
],
"graphql": {
"typeName": "Album"
},
"globalIdFields": [
"AlbumId"
]
},
"version": "v1",
"kind": "ObjectType"
},
{
"definition": {
"name": "Track",
"fields": [
{
"name": "TrackId",
"type": "Int"
},
{
"name": "Name",
"type": "String"
},
{
"name": "AlbumId",
"type": "Int"
}
],
"graphql": {
"typeName": "Track"
}
},
"version": "v1",
"kind": "ObjectType"
},
{
"definition": {
"name": "artist_below_id",
"fields": [
{
"name": "ArtistId",
"type": "Int"
},
{
"name": "Name",
"type": "String"
}
],
"graphql": {
"typeName": "ArtistBelowId"
}
},
"version": "v1",
"kind": "ObjectType"
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "author",
"fields": [
{
"name": "author_id",
"type": "CustomInt!"
},
{
"name": "first_name",
"type": "String!"
},
{
"name": "last_name",
"type": "String!"
}
],
"globalIdFields": [
"author_id"
],
"graphql": {
"typeName": "Author"
}
}
},
{
"kind": "DataConnectorScalarRepresentation",
"version": "v1",
"definition": {
"dataConnectorName": "db",
"dataConnectorScalarType": "varchar",
"representation": "String",
"graphql": {
"comparisonExpressionTypeName": "String_Comparison_Exp"
}
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "commandArticle",
"fields": [
{
"name": "article_id",
"type": "Int!"
},
{
"name": "title",
"type": "String!"
},
{
"name": "author_id",
"type": "Int!"
}
],
"graphql": {
"typeName": "CommandArticle"
}
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "commandArticle",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"article_id",
"title",
"author_id"
]
}
},
{
"role": "user",
"output": {
"allowedFields": [
"article_id",
"title",
"author_id"
]
}
}
]
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "commandAuthor",
"fields": [
{
"name": "id",
"type": "Int!"
},
{
"name": "first_name",
"type": "String!"
},
{
"name": "last_name",
"type": "String!"
}
],
"graphql": {
"typeName": "CommandAuthor"
}
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "commandAuthor",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"id",
"first_name",
"last_name"
]
}
},
{
"role": "user",
"output": {
"allowedFields": [
"id",
"first_name",
"last_name"
]
}
}
]
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_article_by_id",
"permissions": [
{
"role": "admin",
"allowExecution": true
},
{
"role": "user",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_article_by_id",
"arguments": [
{
"name": "article_id",
"type": "Int!"
}
],
"outputType": "commandArticle",
"source": {
"dataConnectorName": "db",
"dataConnectorCommand": {
"function": "get_article_by_id"
},
"typeMapping": {
"commandArticle": {
"fieldMapping": {
"article_id": {
"column": "id"
},
"title": {
"column": "title"
},
"author_id": {
"column": "author_id"
}
}
}
},
"argumentMapping": {
"article_id": "id"
}
},
"graphql": {
"rootFieldName": "getArticleById",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_author_by_id",
"permissions": [
{
"role": "admin",
"allowExecution": true
},
{
"role": "user",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_author_by_id",
"arguments": [
{
"name": "author_id",
"type": "Int!"
}
],
"outputType": "commandAuthor",
"source": {
"dataConnectorName": "db",
"dataConnectorCommand": {
"function": "get_author_by_id"
},
"typeMapping": {
"commandArticle": {
"fieldMapping": {
"author_id": {
"column": "id"
},
"first_name": {
"column": "first_name"
},
"last_name": {
"column": "last_name"
}
}
}
},
"argumentMapping": {
"author_id": "id"
}
},
"graphql": {
"rootFieldName": "getAuthorById",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_latest_article",
"permissions": [
{
"role": "admin",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_latest_article",
"arguments": [],
"outputType": "commandArticle",
"source": {
"dataConnectorName": "db",
"dataConnectorCommand": {
"function": "latest_article"
},
"typeMapping": {
"commandArticle": {
"fieldMapping": {
"article_id": {
"column": "id"
},
"title": {
"column": "title"
},
"author_id": {
"column": "author_id"
}
}
}
}
},
"graphql": {
"rootFieldName": "getLatestArticle",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_latest_article_id",
"permissions": [
{
"role": "admin",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_latest_article_id",
"arguments": [],
"outputType": "Int",
"source": {
"dataConnectorName": "db",
"dataConnectorCommand": {
"function": "latest_article_id"
}
},
"graphql": {
"rootFieldName": "getLatestArticleId",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "update_article_title_by_id",
"permissions": [
{
"role": "admin",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "update_article_title_by_id",
"arguments": [
{
"name": "article_id",
"type": "Int!"
},
{
"name": "title",
"type": "String!"
}
],
"outputType": "commandArticle",
"source": {
"dataConnectorName": "db",
"dataConnectorCommand": {
"procedure": "update_article_title_by_id"
},
"typeMapping": {
"commandArticle": {
"fieldMapping": {
"article_id": {
"column": "id"
},
"title": {
"column": "title"
},
"author_id": {
"column": "author_id"
}
}
}
},
"argumentMapping": {
"article_id": "id",
"title": "title"
}
},
"graphql": {
"rootFieldName": "updateArticleTitleById",
"rootFieldKind": "Mutation"
}
}
},
{
"kind": "Relationship",
"version": "v1",
"definition": {
"source": "commandArticle",
"name": "article",
"target": {
"model": {
"name": "Articles",
"relationshipType": "Object"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "article_id"
}
]
},
"target": {
"modelField": [
{
"fieldName": "article_id"
}
]
}
}
]
}
},
{
"kind": "ScalarType",
"version": "v1",
"definition": {
"name": "CustomInt",
"graphql": {
"typeName": "CustomInt"
}
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "article",
"fields": [
{
"name": "article_id",
"type": "Int!"
},
{
"name": "title",
"type": "String!"
},
{
"name": "author_id",
"type": "CustomInt!"
}
],
"globalIdFields": [
"article_id"
],
"graphql": {
"typeName": "Article"
}
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "test_nullable_array_types",
"fields": [
{
"name": "nullable_field",
"type": "String"
},
{
"name": "non_nullable_field",
"type": "String!"
},
{
"name": "array_field",
"type": "[String!]!"
},
{
"name": "nullable_array_field",
"type": "[String!]"
},
{
"name": "array_nullable_field",
"type": "[String]!"
},
{
"name": "nullable_array_nullable_field",
"type": "[String]"
}
],
"graphql": {
"typeName": "TestNullableArrayTypes"
}
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "Authors",
"objectType": "author",
"globalIdSource": true,
"source": {
"dataConnectorName": "db",
"collection": "authors",
"typeMapping": {
"author": {
"fieldMapping": {
"author_id": {
"column": "id"
},
"first_name": {
"column": "first_name"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "AuthorByID",
"uniqueIdentifier": [
"author_id"
]
}
],
"selectMany": {
"queryRootField": "AuthorMany"
},
"filterExpressionType": "Author_Where_Exp",
"orderByExpressionType": "Author_Order_By"
},
"filterableFields": [
{
"fieldName": "author_id",
"operators": {
"enableAll": true
}
},
{
"fieldName": "first_name",
"operators": {
"enableAll": true
}
},
{
"fieldName": "last_name",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "author_id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "first_name",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "last_name",
"orderByDirections": {
"enableAll": true
}
}
]
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "Articles",
"objectType": "article",
"globalIdSource": true,
"source": {
"dataConnectorName": "db",
"collection": "articles",
"typeMapping": {
"article": {
"fieldMapping": {
"article_id": {
"column": "id"
},
"title": {
"column": "title"
},
"author_id": {
"column": "author_id"
}
}
}
}
},
"filterableFields": [
{
"fieldName": "article_id",
"operators": {
"enableAll": true
}
},
{
"fieldName": "title",
"operators": {
"enableAll": true
}
},
{
"fieldName": "author_id",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "article_id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "title",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "author_id",
"orderByDirections": {
"enableAll": true
}
}
],
"graphql": {
"selectUniques": [
{
"queryRootField": "ArticleByID",
"uniqueIdentifier": [
"article_id"
]
}
],
"selectMany": {
"queryRootField": "ArticleMany"
},
"filterExpressionType": "Article_Where_Exp",
"orderByExpressionType": "Article_Order_By"
}
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "ArticlesByAuthor",
"objectType": "article",
"arguments": [
{
"name": "author_id",
"type": "Int!"
}
],
"source": {
"dataConnectorName": "db",
"collection": "articles_by_author",
"typeMapping": {
"article": {
"fieldMapping": {
"article_id": {
"column": "id"
},
"title": {
"column": "title"
},
"author_id": {
"column": "author_id"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "ArticlesByAuthorByID",
"uniqueIdentifier": [
"article_id"
]
}
],
"selectMany": {
"queryRootField": "ArticlesByAuthorMany"
},
"orderByExpressionType": "ArticlesByAuthorOrderBy",
"filterExpressionType": "ArticlesByAuthorWhereExp",
"argumentsInputType": "ArticlesByAuthorArgs"
},
"filterableFields": [
{
"fieldName": "article_id",
"operators": {
"enableAll": true
}
},
{
"fieldName": "title",
"operators": {
"enableAll": true
}
},
{
"fieldName": "author_id",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "article_id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "title",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "author_id",
"orderByDirections": {
"enableAll": true
}
}
]
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "TestNullableAndArrayTypes",
"objectType": "test_nullable_array_types",
"globalIdSource": false,
"source": {
"dataConnectorName": "db",
"collection": "test_nullable_and_array_types",
"typeMapping": {
"test_nullable_array_types": {
"fieldMapping": {
"nullable_field": {
"column": "nullable_field"
},
"non_nullable_field": {
"column": "non_nullable_field"
},
"array_field": {
"column": "array_field"
},
"nullable_array_field": {
"column": "nullable_array_field"
},
"array_nullable_field": {
"column": "array_nullable_field"
},
"nullable_array_nullable_field": {
"column": "nullable_array_nullable_field"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "TestNullableAndArrayById",
"uniqueIdentifier": [
"nullable_field",
"non_nullable_field",
"array_field",
"nullable_array_field",
"array_nullable_field",
"nullable_array_nullable_field"
]
}
],
"filterExpressionType": "Test_Nullable_And_Array_Types_Where_Exp"
},
"filterableFields": [
{
"fieldName": "nullable_field",
"operators": {
"enableAll": true
}
},
{
"fieldName": "non_nullable_field",
"operators": {
"enableAll": true
}
},
{
"fieldName": "array_field",
"operators": {
"enableAll": true
}
},
{
"fieldName": "nullable_array_field",
"operators": {
"enableAll": true
}
},
{
"fieldName": "array_nullable_field",
"operators": {
"enableAll": true
}
},
{
"fieldName": "nullable_array_nullable_field",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "nullable_field",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "non_nullable_field",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "array_field",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "nullable_array_field",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "array_nullable_field",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "nullable_array_nullable_field",
"orderByDirections": {
"enableAll": true
}
}
]
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "author",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"author_id",
"first_name"
]
}
}
]
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "test_nullable_array_types",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"nullable_field",
"non_nullable_field",
"array_field",
"nullable_array_field",
"array_nullable_field",
"nullable_array_nullable_field"
]
}
},
{
"role": "user",
"output": {
"allowedFields": [
"nullable_field",
"non_nullable_field",
"array_field",
"nullable_array_field",
"array_nullable_field",
"nullable_array_nullable_field"
]
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "TestNullableAndArrayTypes",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
},
{
"role": "user",
"select": {
"filter": null
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "Authors",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "ArticlesByAuthor",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "article",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"article_id",
"title",
"author_id"
]
}
},
{
"role": "user_1",
"output": {
"allowedFields": [
"article_id",
"author_id"
]
}
},
{
"role": "user_2",
"output": {
"allowedFields": [
"article_id",
"title"
]
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "Articles",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
},
{
"role": "user_1",
"select": {
"filter": {
"fieldComparison": {
"field": "author_id",
"operator": "_eq",
"value": {
"sessionVariable": "x-hasura-user-id"
}
}
}
}
},
{
"role": "user_2",
"select": {
"filter": {
"and": [
{
"fieldComparison": {
"field": "title",
"operator": "_like",
"value": {
"literal": "%Functional%"
}
}
},
{
"not": {
"fieldComparison": {
"field": "author_id",
"operator": "_is_null"
}
}
}
]
}
}
}
]
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "TestTypeForScalars",
"fields": [
{
"name": "id",
"type": "Int"
},
{
"name": "name",
"type": "CustomString"
}
],
"graphql": {
"typeName": "TestTypeForScalars"
}
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "TestTypeForScalars",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"id",
"name"
]
}
}
]
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "TestModelForScalars",
"objectType": "TestTypeForScalars",
"filterableFields": [
{
"fieldName": "id",
"operators": {
"enableAll": true
}
},
{
"fieldName": "name",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "name",
"orderByDirections": {
"enableAll": true
}
}
],
"graphql": {
"selectUniques": [
{
"queryRootField": "TestModelByID",
"uniqueIdentifier": [
"id"
]
},
{
"queryRootField": "TestModelByName",
"uniqueIdentifier": [
"name"
]
}
]
}
}
},
{
"kind": "ScalarType",
"version": "v1",
"definition": {
"name": "CustomString",
"graphql": {
"typeName": "CustomString"
}
}
},
{
"kind": "Relationship",
"version": "v1",
"definition": {
"source": "author",
"name": "Articles",
"target": {
"model": {
"name": "Articles",
"relationshipType": "Array"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "author_id"
}
]
},
"target": {
"modelField": [
{
"fieldName": "author_id"
}
]
}
}
]
}
},
{
"kind": "Relationship",
"version": "v1",
"definition": {
"source": "article",
"name": "Author",
"target": {
"model": {
"name": "Authors",
"relationshipType": "Object"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "author_id"
}
]
},
"target": {
"modelField": [
{
"fieldName": "author_id"
}
]
}
}
]
}
},
{
"definition": {
"name": "Artists",
"objectType": "Artist",
"source": {
"dataConnectorName": "db",
"collection": "Artist",
"typeMapping": {
"Artist": {
"fieldMapping": {
"ArtistId": {
"column": "ArtistId"
},
"Name": {
"column": "Name"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "ArtistByID",
"uniqueIdentifier": [
"ArtistId"
]
}
],
"selectMany": {
"queryRootField": "Artist"
},
"filterExpressionType": "Artist_Where_Exp",
"orderByExpressionType": "Artist_Order_By"
},
"filterableFields": [
{
"fieldName": "ArtistId",
"operators": {
"enableAll": true
}
},
{
"fieldName": "Name",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "ArtistId",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "Name",
"orderByDirections": {
"enableAll": true
}
}
]
},
"version": "v1",
"kind": "Model"
},
{
"definition": {
"name": "Albums",
"objectType": "Album",
"globalIdSource": true,
"source": {
"dataConnectorName": "db",
"collection": "Album",
"typeMapping": {
"Album": {
"fieldMapping": {
"AlbumId": {
"column": "AlbumId"
},
"Title": {
"column": "Title"
},
"ArtistId": {
"column": "ArtistId"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "AlbumByID",
"uniqueIdentifier": [
"AlbumId"
]
}
],
"selectMany": {
"queryRootField": "Album"
},
"filterExpressionType": "Album_Where_Exp",
"orderByExpressionType": "Album_Order_By"
},
"filterableFields": [
{
"fieldName": "AlbumId",
"operators": {
"enableAll": true
}
},
{
"fieldName": "Title",
"operators": {
"enableAll": true
}
},
{
"fieldName": "ArtistId",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "AlbumId",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "Title",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "ArtistId",
"orderByDirections": {
"enableAll": true
}
}
]
},
"version": "v1",
"kind": "Model"
},
{
"definition": {
"name": "Tracks",
"objectType": "Track",
"source": {
"dataConnectorName": "db",
"collection": "Track",
"typeMapping": {
"Track": {
"fieldMapping": {
"TrackId": {
"column": "TrackId"
},
"Name": {
"column": "Name"
},
"AlbumId": {
"column": "AlbumId"
}
}
}
}
},
"graphql": {
"selectUniques": [
{
"queryRootField": "TrackByID",
"uniqueIdentifier": [
"TrackId"
]
}
],
"selectMany": {
"queryRootField": "Track"
},
"filterExpressionType": "Track_Where_Exp",
"orderByExpressionType": "Track_Order_By"
},
"filterableFields": [
{
"fieldName": "TrackId",
"operators": {
"enableAll": true
}
},
{
"fieldName": "Name",
"operators": {
"enableAll": true
}
},
{
"fieldName": "AlbumId",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "TrackId",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "Name",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "AlbumId",
"orderByDirections": {
"enableAll": true
}
}
]
},
"version": "v1",
"kind": "Model"
},
{
"definition": {
"name": "artist_below_id",
"objectType": "artist_below_id",
"source": {
"dataConnectorName": "db",
"collection": "artist_below_id",
"typeMapping": {
"Artist": {
"fieldMapping": {
"ArtistId": {
"column": "ArtistId"
},
"Name": {
"column": "Name"
}
}
}
}
},
"filterableFields": [
{
"fieldName": "ArtistId",
"operators": {
"enableAll": true
}
},
{
"fieldName": "Name",
"operators": {
"enableAll": true
}
}
],
"orderableFields": [
{
"fieldName": "ArtistId",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "Name",
"orderByDirections": {
"enableAll": true
}
}
]
},
"version": "v1",
"kind": "Model"
},
{
"definition": {
"typeName": "Artist",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"ArtistId",
"Name"
]
}
}
]
},
"version": "v1",
"kind": "TypePermissions"
},
{
"definition": {
"typeName": "Album",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"AlbumId",
"Title",
"ArtistId"
]
}
}
]
},
"version": "v1",
"kind": "TypePermissions"
},
{
"definition": {
"typeName": "Track",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"TrackId",
"Name",
"AlbumId"
]
}
}
]
},
"version": "v1",
"kind": "TypePermissions"
},
{
"definition": {
"typeName": "artist_below_id",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": [
"ArtistId",
"Name"
]
}
}
]
},
"version": "v1",
"kind": "TypePermissions"
},
{
"definition": {
"modelName": "Artists",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
},
"version": "v1",
"kind": "ModelPermissions"
},
{
"definition": {
"modelName": "Albums",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
},
"version": "v1",
"kind": "ModelPermissions"
},
{
"definition": {
"modelName": "Tracks",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
},
"version": "v1",
"kind": "ModelPermissions"
},
{
"definition": {
"modelName": "artist_below_id",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
}
]
},
"version": "v1",
"kind": "ModelPermissions"
},
{
"definition": {
"source": "Artist",
"name": "Albums",
"target": {
"model": {
"name": "Albums",
"relationshipType": "Array"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "ArtistId"
}
]
},
"target": {
"modelField": [
{
"fieldName": "ArtistId"
}
]
}
}
]
},
"version": "v1",
"kind": "Relationship"
},
{
"definition": {
"source": "Album",
"name": "Tracks",
"target": {
"model": {
"name": "Tracks",
"relationshipType": "Array"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "AlbumId"
}
]
},
"target": {
"modelField": [
{
"fieldName": "AlbumId"
}
]
}
}
]
},
"version": "v1",
"kind": "Relationship"
},
{
"definition": {
"source": "Album",
"name": "Artist",
"target": {
"model": {
"name": "Artists",
"relationshipType": "Object"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "ArtistId"
}
]
},
"target": {
"modelField": [
{
"fieldName": "ArtistId"
}
]
}
}
]
},
"version": "v1",
"kind": "Relationship"
},
{
"definition": {
"source": "article",
"name": "AuthorFromCommand",
"target": {
"command": {
"name": "get_author_by_id"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "author_id"
}
]
},
"target": {
"argument": {
"argumentName": "author_id"
}
}
}
]
},
"version": "v1",
"kind": "Relationship"
},
{
"definition": {
"source": "Track",
"name": "Album",
"target": {
"model": {
"name": "Albums",
"relationshipType": "Object"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "AlbumId"
}
]
},
"target": {
"modelField": [
{
"fieldName": "AlbumId"
}
]
}
}
]
},
"version": "v1",
"kind": "Relationship"
},
{
"kind": "DataConnectorScalarRepresentation",
"version": "v1",
"definition": {
"dataConnectorName": "db",
"dataConnectorScalarType": "int8",
"representation": "CustomInt"
}
},
{
"definition": {
"dataConnectorName": "db",
"dataConnectorScalarType": "int4",
"representation": "Int",
"graphql": {
"comparisonExpressionTypeName": "int4_comparison"
}
},
"version": "v1",
"kind": "DataConnectorScalarRepresentation"
}
]
}
]
}