{ "version": "v2", "subgraphs": [ { "name": "default", "objects": [ { "kind": "DataConnectorScalarRepresentation", "version": "v1", "definition": { "dataConnectorName": "db", "dataConnectorScalarType": "String", "representation": "String", "graphql": { "comparisonExpressionTypeName": "String_Comparison_Exp" } } }, { "kind": "ObjectType", "version": "v1", "definition": { "name": "Actor", "description": "Object to identify an actor.", "fields": [ { "name": "actor_id", "description": "Unique ID to identify an actor.", "type": "Int!" }, { "name": "name", "description": "Name of the actor.", "type": "String!" }, { "name": "movie_id", "description": "Movie ID.", "type": "Int!" } ], "graphql": { "typeName": "Actor" }, "dataConnectorTypeMapping": [ { "dataConnectorName": "custom", "dataConnectorObjectType": "actor", "fieldMapping": { "actor_id": { "column": { "name": "id" } }, "name": { "column": { "name": "name" } }, "movie_id": { "column": { "name": "movie_id" } } } } ] } }, { "kind": "ObjectType", "version": "v1", "definition": { "name": "author", "fields": [ { "name": "author_id", "description": "Identifier to uniquely identify an author", "type": "Int!" }, { "name": "first_name", "type": "String!" }, { "name": "last_name", "type": "String!" } ], "graphql": { "typeName": "Author" } } }, { "kind": "TypePermissions", "version": "v1", "definition": { "typeName": "author", "permissions": [ { "role": "admin", "output": { "allowedFields": ["author_id", "first_name", "last_name"] } }, { "role": "user", "output": { "allowedFields": ["author_id", "first_name", "last_name"] } } ] } }, { "kind": "Model", "version": "v1", "definition": { "name": "Authors", "objectType": "author", "arguments": [ { "name": "authors_arg", "type": "Int!", "description": "Authors argument description" } ], "graphql": { "selectUniques": [ { "queryRootField": "AuthorByID", "description": "Selecting an author by ID", "uniqueIdentifier": ["author_id"] } ], "selectMany": { "queryRootField": "AuthorMany" }, "orderByExpressionType": "AuthorOrderBy", "argumentsInputType": "AuthorArgs" }, "orderableFields": [ { "fieldName": "author_id", "orderByDirections": { "enableAll": true } }, { "fieldName": "first_name", "orderByDirections": { "enableAll": true } }, { "fieldName": "last_name", "orderByDirections": { "enableAll": true } } ] } }, { "kind": "ModelPermissions", "version": "v1", "definition": { "modelName": "Authors", "permissions": [ { "role": "admin", "select": { "filter": null } }, { "role": "user", "select": { "filter": null } } ] } }, { "kind": "TypePermissions", "version": "v1", "definition": { "typeName": "Actor", "permissions": [ { "role": "admin", "output": { "allowedFields": ["actor_id", "name", "movie_id"] } } ] } }, { "kind": "ScalarType", "version": "v1", "definition": { "description": "Opaque scalar type description.", "name": "Opaque", "graphql": { "typeName": "Opaque" } } }, { "kind": "ObjectType", "version": "v1", "definition": { "name": "NameFilterOpaqueSurname", "description": "Some description for custom input object type", "fields": [ { "name": "first_name", "description": "Some description of first name", "type": "String" }, { "name": "surname", "description": "Some description of last name", "type": "Opaque" } ], "graphql": { "inputTypeName": "NameFilterOpaqueSurname" }, "dataConnectorTypeMapping": [ { "dataConnectorName": "custom", "dataConnectorObjectType": "name_query", "fieldMapping": { "first_name": { "column": { "name": "first_name" } }, "surname": { "column": { "name": "last_name" } } } } ] } }, { "kind": "Command", "version": "v1", "definition": { "name": "get_actors_by_name_opaque_surname", "arguments": [ { "name": "name_filter", "type": "NameFilterOpaqueSurname!" } ], "outputType": "[Actor!]!", "source": { "dataConnectorName": "custom", "dataConnectorCommand": { "function": "get_actors_by_name" }, "argumentMapping": { "name_filter": "name" } }, "graphql": { "rootFieldName": "getActorsByNameOpaqueSurname", "rootFieldKind": "Query" } } }, { "kind": "CommandPermissions", "version": "v1", "definition": { "commandName": "get_actors_by_name_opaque_surname", "permissions": [ { "role": "admin", "allowExecution": true } ] } }, { "kind": "Command", "version": "v1", "definition": { "name": "get_actors_by_opaque_name", "description": "Command to get the actors matching a given name.", "arguments": [ { "name": "name_filter", "description": "name_filter command argument description", "type": "Opaque!" } ], "outputType": "[Actor!]!", "source": { "dataConnectorName": "custom", "dataConnectorCommand": { "function": "get_actors_by_name" }, "argumentMapping": { "name_filter": "name" } }, "graphql": { "rootFieldName": "getActorsByOpaqueName", "rootFieldKind": "Query" } } }, { "kind": "CommandPermissions", "version": "v1", "definition": { "commandName": "get_actors_by_opaque_name", "permissions": [ { "role": "admin", "allowExecution": true } ] } }, { "kind": "ObjectType", "version": "v1", "definition": { "name": "article", "fields": [ { "name": "article_id", "type": "Int!" }, { "name": "title", "type": "String!" }, { "name": "author_id", "type": "Int!" } ], "graphql": { "typeName": "Article" } } }, { "kind": "TypePermissions", "version": "v1", "definition": { "typeName": "article", "permissions": [ { "role": "admin", "output": { "allowedFields": ["article_id", "title", "author_id"] } }, { "role": "user", "output": { "allowedFields": ["title", "author_id", "article_id"] } } ] } }, { "kind": "Model", "version": "v1", "definition": { "name": "Articles", "objectType": "article", "orderableFields": [ { "fieldName": "article_id", "orderByDirections": { "enableAll": true } }, { "fieldName": "title", "orderByDirections": { "enableAll": true } }, { "fieldName": "author_id", "orderByDirections": { "enableAll": true } } ] } }, { "kind": "ModelPermissions", "version": "v1", "definition": { "modelName": "Articles", "permissions": [ { "role": "admin", "select": { "filter": null } }, { "role": "user", "select": { "filter": null } } ] } }, { "kind": "Relationship", "version": "v1", "definition": { "sourceType": "author", "name": "Articles_relationship", "description": "Gets the corresponding articles of the author.", "target": { "model": { "name": "Articles", "relationshipType": "Array" } }, "mapping": [ { "source": { "fieldPath": [ { "fieldName": "author_id" } ] }, "target": { "modelField": [ { "fieldName": "author_id" } ] } } ] } } ] } ] }