Converted demo to use Docker Compose
This commit is contained in:
45
bbconf/basebox/bb_todo-datamodel.sql
Normal file
45
bbconf/basebox/bb_todo-datamodel.sql
Normal file
@ -0,0 +1,45 @@
|
||||
--
|
||||
-- Generated by basebox compiler (bbc) version 0.1.0-beta.23 at 2023-11-01 10:35:59+01:00
|
||||
--
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
|
||||
CREATE TABLE "List" (
|
||||
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
|
||||
"title" VARCHAR NOT NULL,
|
||||
"user_username" VARCHAR NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "Task" (
|
||||
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
|
||||
"title" VARCHAR NOT NULL,
|
||||
"description" VARCHAR,
|
||||
"completed" BOOLEAN NOT NULL,
|
||||
"user_username" VARCHAR NOT NULL,
|
||||
"list_id" UUID NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "User" (
|
||||
"username" VARCHAR NOT NULL,
|
||||
"name" VARCHAR
|
||||
);
|
||||
|
||||
ALTER TABLE "List" ADD COLUMN ".ownerId" VARCHAR NOT NULL;
|
||||
|
||||
ALTER TABLE "Task" ADD COLUMN ".ownerId" VARCHAR NOT NULL;
|
||||
|
||||
ALTER TABLE "User" ADD COLUMN ".ownerId" VARCHAR NOT NULL;
|
||||
|
||||
ALTER TABLE "List" ADD PRIMARY KEY ("id");
|
||||
|
||||
ALTER TABLE "Task" ADD PRIMARY KEY ("id");
|
||||
|
||||
ALTER TABLE "User" ADD PRIMARY KEY ("username");
|
||||
|
||||
ALTER TABLE "List" ADD CONSTRAINT fk_list_1 FOREIGN KEY ("user_username") REFERENCES "User" ("username");
|
||||
|
||||
ALTER TABLE "Task" ADD CONSTRAINT fk_task_2 FOREIGN KEY ("user_username") REFERENCES "User" ("username");
|
||||
|
||||
ALTER TABLE "Task" ADD CONSTRAINT fk_task_3 FOREIGN KEY ("list_id") REFERENCES "List" ("id");
|
||||
|
||||
ALTER TABLE "User" ADD CONSTRAINT uq_user_4 UNIQUE (".ownerId");
|
||||
|
223
bbconf/basebox/bb_todo-resolver.toml
Normal file
223
bbconf/basebox/bb_todo-resolver.toml
Normal file
@ -0,0 +1,223 @@
|
||||
#
|
||||
# Generated by bbc (basebox compiler) version 0.1.0-beta.23 at 2023-11-01 10:35:59+01:00
|
||||
#
|
||||
[resolvers._bb_user_User]
|
||||
operation_name = "_bb_user_User"
|
||||
|
||||
[resolvers._bb_user_User.resolver.InternalQueryBuilder]
|
||||
command_type = "SQLSelect"
|
||||
|
||||
[resolvers._bb_user_User.resolver.InternalQueryBuilder.command]
|
||||
table = "User"
|
||||
command_type = "SQLSelect"
|
||||
modify_values = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers._bb_user_User.resolver.InternalQueryBuilder.command.columns]]
|
||||
|
||||
[resolvers._bb_user_User.resolver.InternalQueryBuilder.command.columns.Column]
|
||||
table = "User"
|
||||
column = "username"
|
||||
|
||||
[[resolvers._bb_user_User.resolver.InternalQueryBuilder.command.where_clauses]]
|
||||
table = "User"
|
||||
column = ".ownerId"
|
||||
condition_str = "= $1"
|
||||
index = ""
|
||||
|
||||
[resolvers.updateTask]
|
||||
operation_name = "updateTask"
|
||||
|
||||
[resolvers.updateTask.resolver.QueryBuilder]
|
||||
command_type = "SQLUpdate"
|
||||
|
||||
[resolvers.updateTask.resolver.QueryBuilder.command]
|
||||
table = "Task"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.updateTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "title"
|
||||
value = "'$title'"
|
||||
|
||||
[[resolvers.updateTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "description"
|
||||
value = "'$description'"
|
||||
|
||||
[[resolvers.updateTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "completed"
|
||||
value = "'$completed'"
|
||||
|
||||
[[resolvers.updateTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "list_id"
|
||||
value = "'$list.$id'"
|
||||
|
||||
[[resolvers.updateTask.resolver.QueryBuilder.command.where_clauses]]
|
||||
table = "Task"
|
||||
column = "id"
|
||||
condition_str = "= '$id'"
|
||||
index = ""
|
||||
|
||||
[resolvers.createTask]
|
||||
operation_name = "createTask"
|
||||
|
||||
[resolvers.createTask.resolver.QueryBuilder]
|
||||
command_type = "SQLInsert"
|
||||
|
||||
[resolvers.createTask.resolver.QueryBuilder.command]
|
||||
table = "Task"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
nested_modify_tables = []
|
||||
where_clauses = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.createTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "title"
|
||||
value = "'$title'"
|
||||
|
||||
[[resolvers.createTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "description"
|
||||
value = "'$description'"
|
||||
|
||||
[[resolvers.createTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "completed"
|
||||
value = "'$completed'"
|
||||
|
||||
[[resolvers.createTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "list_id"
|
||||
value = "'$list.$id'"
|
||||
|
||||
[[resolvers.createTask.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "user_username"
|
||||
value = "'$user.$username'"
|
||||
|
||||
[resolvers.createUser]
|
||||
operation_name = "createUser"
|
||||
|
||||
[resolvers.createUser.resolver.QueryBuilder]
|
||||
command_type = "SQLInsert"
|
||||
|
||||
[resolvers.createUser.resolver.QueryBuilder.command]
|
||||
table = "User"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
nested_modify_tables = []
|
||||
where_clauses = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.createUser.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "username"
|
||||
value = "'$username'"
|
||||
|
||||
[[resolvers.createUser.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "name"
|
||||
value = "'$name'"
|
||||
|
||||
[resolvers.deleteTask]
|
||||
operation_name = "deleteTask"
|
||||
|
||||
[resolvers.deleteTask.resolver.QueryBuilder]
|
||||
command_type = "SQLDelete"
|
||||
|
||||
[resolvers.deleteTask.resolver.QueryBuilder.command]
|
||||
table = "Task"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
modify_values = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.deleteTask.resolver.QueryBuilder.command.where_clauses]]
|
||||
table = "Task"
|
||||
column = "id"
|
||||
condition_str = "= '$id'"
|
||||
index = ""
|
||||
|
||||
[resolvers.getUser]
|
||||
operation_name = "getUser"
|
||||
|
||||
[resolvers.getUser.resolver.QueryBuilder]
|
||||
command_type = "SQLSelect"
|
||||
|
||||
[resolvers.getUser.resolver.QueryBuilder.command]
|
||||
table = "User"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
modify_values = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.getUser.resolver.QueryBuilder.command.where_clauses]]
|
||||
table = "User"
|
||||
column = "username"
|
||||
condition_str = "= '$username'"
|
||||
index = ""
|
||||
|
||||
[resolvers.createList]
|
||||
operation_name = "createList"
|
||||
|
||||
[resolvers.createList.resolver.QueryBuilder]
|
||||
command_type = "SQLInsert"
|
||||
|
||||
[resolvers.createList.resolver.QueryBuilder.command]
|
||||
table = "List"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
nested_modify_tables = []
|
||||
where_clauses = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.createList.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "title"
|
||||
value = "'$title'"
|
||||
|
||||
[[resolvers.createList.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "user_username"
|
||||
value = "'$user.$username'"
|
||||
|
||||
[resolvers.updateList]
|
||||
operation_name = "updateList"
|
||||
|
||||
[resolvers.updateList.resolver.QueryBuilder]
|
||||
command_type = "SQLUpdate"
|
||||
|
||||
[resolvers.updateList.resolver.QueryBuilder.command]
|
||||
table = "List"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.updateList.resolver.QueryBuilder.command.modify_values]]
|
||||
column = "title"
|
||||
value = "'$title'"
|
||||
|
||||
[[resolvers.updateList.resolver.QueryBuilder.command.where_clauses]]
|
||||
table = "List"
|
||||
column = "id"
|
||||
condition_str = "= '$id'"
|
||||
index = ""
|
||||
|
||||
[resolvers.deleteList]
|
||||
operation_name = "deleteList"
|
||||
|
||||
[resolvers.deleteList.resolver.QueryBuilder]
|
||||
command_type = "SQLDelete"
|
||||
|
||||
[resolvers.deleteList.resolver.QueryBuilder.command]
|
||||
table = "List"
|
||||
command_type = "SQLSelect"
|
||||
columns = []
|
||||
modify_values = []
|
||||
nested_modify_tables = []
|
||||
aggregate_result = true
|
||||
|
||||
[[resolvers.deleteList.resolver.QueryBuilder.command.where_clauses]]
|
||||
table = "List"
|
||||
column = "id"
|
||||
condition_str = "= '$id'"
|
||||
index = ""
|
200
bbconf/basebox/bb_todo-typemap.json
Normal file
200
bbconf/basebox/bb_todo-typemap.json
Normal file
@ -0,0 +1,200 @@
|
||||
{
|
||||
"type_list": [
|
||||
{
|
||||
"Object": {
|
||||
"gql_object": "List",
|
||||
"sql_table": "List"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "List",
|
||||
"gql_field": "id",
|
||||
"sql_table": "List",
|
||||
"sql_column": "id"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "List",
|
||||
"gql_field": "title",
|
||||
"sql_table": "List",
|
||||
"sql_column": "title"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Object": {
|
||||
"gql_object": "Task",
|
||||
"sql_table": "Task"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "id",
|
||||
"sql_table": "Task",
|
||||
"sql_column": "id"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "title",
|
||||
"sql_table": "Task",
|
||||
"sql_column": "title"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "description",
|
||||
"sql_table": "Task",
|
||||
"sql_column": "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "completed",
|
||||
"sql_table": "Task",
|
||||
"sql_column": "completed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Object": {
|
||||
"gql_object": "User",
|
||||
"sql_table": "User"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "User",
|
||||
"gql_field": "username",
|
||||
"sql_table": "User",
|
||||
"sql_column": "username"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ObjectField": {
|
||||
"gql_object": "User",
|
||||
"gql_field": "name",
|
||||
"sql_table": "User",
|
||||
"sql_column": "name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "List",
|
||||
"gql_field": "user",
|
||||
"gql_type": "User",
|
||||
"sql_join_type": {
|
||||
"ManyToOne": {
|
||||
"sql_table_of_object": "List",
|
||||
"sql_table_of_field": "User",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"user_username",
|
||||
"username"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "User",
|
||||
"gql_field": "lists",
|
||||
"gql_type": "List",
|
||||
"sql_join_type": {
|
||||
"OneToMany": {
|
||||
"sql_table_of_object": "User",
|
||||
"sql_table_of_field": "List",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"username",
|
||||
"user_username"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "user",
|
||||
"gql_type": "User",
|
||||
"sql_join_type": {
|
||||
"ManyToOne": {
|
||||
"sql_table_of_object": "Task",
|
||||
"sql_table_of_field": "User",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"user_username",
|
||||
"username"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "User",
|
||||
"gql_field": "tasks",
|
||||
"gql_type": "Task",
|
||||
"sql_join_type": {
|
||||
"OneToMany": {
|
||||
"sql_table_of_object": "User",
|
||||
"sql_table_of_field": "Task",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"username",
|
||||
"user_username"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "Task",
|
||||
"gql_field": "list",
|
||||
"gql_type": "List",
|
||||
"sql_join_type": {
|
||||
"ManyToOne": {
|
||||
"sql_table_of_object": "Task",
|
||||
"sql_table_of_field": "List",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"list_id",
|
||||
"id"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Join": {
|
||||
"gql_object": "List",
|
||||
"gql_field": "tasks",
|
||||
"gql_type": "Task",
|
||||
"sql_join_type": {
|
||||
"OneToMany": {
|
||||
"sql_table_of_object": "List",
|
||||
"sql_table_of_field": "Task",
|
||||
"sql_mapped_columns": [
|
||||
[
|
||||
"id",
|
||||
"list_id"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
63
bbconf/basebox/broker-config.toml
Normal file
63
bbconf/basebox/broker-config.toml
Normal file
@ -0,0 +1,63 @@
|
||||
[generic]
|
||||
# log level; can be error, warn, info, debug, trace
|
||||
log_level = "trace"
|
||||
|
||||
[graphql]
|
||||
# path and file name to GraphQL schema file
|
||||
schema_file = "/bbconf/schema.graphql"
|
||||
allow_introspection = true
|
||||
|
||||
[proxy]
|
||||
# host name or IP of basebox DB proxy
|
||||
host = "dbproxy"
|
||||
port = 8081
|
||||
# Whether to use http or https to connect to the proxy
|
||||
tls = false
|
||||
|
||||
[server]
|
||||
# Host name of the broker (GraphQL server)
|
||||
host = "broker"
|
||||
|
||||
# Port number; default is 80 for http, 443 for https
|
||||
port = 8080
|
||||
|
||||
max_request_size = 33554433
|
||||
|
||||
[auth]
|
||||
# Contents of 'iss' field, usually the URL of the authentication realm
|
||||
iss = "https://basebox-test-1.eu.auth0.com/"
|
||||
# Access token audience field
|
||||
aud = "basebox-todo"
|
||||
|
||||
# public key file for the IdP server (KeyCloak in this case)
|
||||
# jwks_file = "/bbconf/idp_keys.json"
|
||||
|
||||
#####
|
||||
|
||||
# OpenID Connect scope; default is "openid profile email"
|
||||
scope = "openid profile email"
|
||||
|
||||
# Fully qualified URL to the OAuth2 callback endpoint.
|
||||
# After the user entered his/her credentials at the IdP's login form, the client will be redirected
|
||||
# to this URL. When the client receives a request to this URL, it must send the request's query
|
||||
# string to the broker's "openid_connect_path" set below.
|
||||
#redirect_url = "http://127.0.0.1:5167/oauth-callback"
|
||||
|
||||
# OpenID Connect login completion request path.
|
||||
# The client must pass the query string from the call to "redirect_url" to this URL and gets
|
||||
# a basebox session token in return.
|
||||
#openid_connect_path = "/oauth/complete-login"
|
||||
|
||||
# Path to the browser login URL.
|
||||
# This path is where the basebox broker returns a 302 response that redirects the browser to
|
||||
# the IdP login page; the target URL will contain all query parms needed to initiate an
|
||||
# auth code flow login procedure, incl. CSRF protection tokens etc.
|
||||
#login_path = "/oauth/login"
|
||||
|
||||
# Logout path that allows explicit, immediate logouts.
|
||||
# Simply POST to this URL with the session cookie or bearer token.
|
||||
#logout_path = "/oauth/logout"
|
||||
|
||||
# TODO - need?
|
||||
# Set to true to get a user's additional claims from OAuth2
|
||||
user_info_additional_claims_required = true
|
55
bbconf/basebox/dbproxy-config.toml
Normal file
55
bbconf/basebox/dbproxy-config.toml
Normal file
@ -0,0 +1,55 @@
|
||||
[generic]
|
||||
# log level; can be error, warn, info, debug, trace
|
||||
log_level = "trace"
|
||||
|
||||
|
||||
[oidc_config]
|
||||
# `mode` can be either "access-token" or "client". In access-token mode, all clients sending
|
||||
# GraphQL requests to basebox just pass an access token in the "Authorization" HTTP header.
|
||||
# In client mode, basebox acts as the OpenID Connect client and requests ID and access tokens
|
||||
# from the OpenID Connect server on behalf of the client.
|
||||
# See https://docs.basebox.io/guide/authorization
|
||||
mode = "access-token"
|
||||
|
||||
# Access token validation:
|
||||
# Contents of 'iss' field, usually the URL of the authentication realm
|
||||
#iss = "https://www.idp.com:8090/realms/master"
|
||||
# iss = "https://kcdev.basebox.io:8443/realms/test-runner"
|
||||
|
||||
# # Contents of the 'aud' field for access tokens; for Keycloak, this defaults to 'account';
|
||||
# # for Auth0, this is the value of the Default Audience field in your Tenant settings.
|
||||
# aud = "account"
|
||||
|
||||
# Contents of 'iss' field, usually the URL of the authentication realm
|
||||
iss = "https://basebox-test-1.eu.auth0.com/"
|
||||
# Access token audience field
|
||||
aud = "basebox-todo"
|
||||
|
||||
# public key file for the IdP server (KeyCloak in this case)
|
||||
#jwks_file = "/bbconf/idp_keys.json"
|
||||
|
||||
[graphql]
|
||||
# path and file name to GraphQL schema file
|
||||
schema_file = "/bbconf/schema.graphql"
|
||||
# Path and file name of the resolver map file
|
||||
resolver_map_file = "/bbconf/bb_todo-resolver.toml"
|
||||
# Path and file name of the type map file
|
||||
type_map_file = "/bbconf/bb_todo-typemap.json"
|
||||
|
||||
[database]
|
||||
db_type = "postgres"
|
||||
host = "host.docker.internal"
|
||||
port = 5430
|
||||
ssl_mode = "no"
|
||||
db_name = "bb_todo"
|
||||
username = "bb_todo"
|
||||
password = "bigsecret"
|
||||
|
||||
[server]
|
||||
# Host name of (this) proxy server
|
||||
host = "dbproxy"
|
||||
|
||||
# Port to serve on
|
||||
port = 8081
|
||||
|
||||
max_request_size = 33554432
|
139
bbconf/basebox/schema.graphql
Normal file
139
bbconf/basebox/schema.graphql
Normal file
@ -0,0 +1,139 @@
|
||||
directive @bb_primaryKey on FIELD_DEFINITION
|
||||
directive @bb_resolver on FIELD_DEFINITION
|
||||
directive @bb_owned on OBJECT
|
||||
directive @bb_user on OBJECT
|
||||
|
||||
"""
|
||||
List of tasks or todo items.
|
||||
"""
|
||||
type List @bb_owned {
|
||||
id: ID!
|
||||
title: String!
|
||||
tasks: [Task]
|
||||
user: User!
|
||||
}
|
||||
|
||||
input ListInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
"""
|
||||
Task or todo item.
|
||||
"""
|
||||
type Task @bb_owned {
|
||||
id: ID!
|
||||
title: String!
|
||||
description: String,
|
||||
completed: Boolean!
|
||||
user: User!
|
||||
list: List!
|
||||
}
|
||||
|
||||
"""
|
||||
User type; owner of lists and tasks
|
||||
"""
|
||||
type User @bb_user {
|
||||
username: String! @bb_primaryKey
|
||||
name: String
|
||||
tasks: [Task]
|
||||
lists: [List]
|
||||
}
|
||||
|
||||
input UserInput {
|
||||
username: String!
|
||||
name: String
|
||||
}
|
||||
|
||||
type Query {
|
||||
|
||||
"""
|
||||
Get a user, this will be used to get the current user as well as the user's lists and tasks.
|
||||
"""
|
||||
getUser(
|
||||
username: String!
|
||||
): User
|
||||
@bb_resolver(
|
||||
_type: SELECT,
|
||||
_object: User,
|
||||
_filter: { username: { _eq: "$username" } })
|
||||
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
createUser(
|
||||
username: String!,
|
||||
name: String!
|
||||
): User
|
||||
@bb_resolver(
|
||||
_type: INSERT,
|
||||
_object: User,
|
||||
_fields: { username: "$username", name: "$name" })
|
||||
|
||||
createList(
|
||||
title: String!
|
||||
user: UserInput!
|
||||
): List
|
||||
@bb_resolver(
|
||||
_type: INSERT,
|
||||
_object: List,
|
||||
_fields: {
|
||||
title: "$title",
|
||||
user: { username: "$user.$username" }
|
||||
})
|
||||
|
||||
updateList(
|
||||
id: ID!,
|
||||
title: String!
|
||||
): List
|
||||
@bb_resolver(
|
||||
_type: UPDATE,
|
||||
_object: List,
|
||||
_filter: { id: { _eq: "$id" } },
|
||||
_fields: { title: "$title" })
|
||||
|
||||
deleteList(id: ID!): List
|
||||
@bb_resolver(_type: DELETE, _object: List, _filter: { id: { _eq: "$id" } })
|
||||
|
||||
createTask(
|
||||
title: String!,
|
||||
description: String,
|
||||
completed: Boolean!,
|
||||
list: ListInput!
|
||||
user: UserInput!
|
||||
): Task
|
||||
@bb_resolver(
|
||||
_type: INSERT,
|
||||
_object: Task,
|
||||
_fields: {
|
||||
title: "$title",
|
||||
description: "$description",
|
||||
completed: "$completed",
|
||||
list: { id: "$list.$id" },
|
||||
user: { username: "$user.$username" } })
|
||||
|
||||
updateTask(
|
||||
id: ID!,
|
||||
title: String,
|
||||
description: String,
|
||||
completed: Boolean,
|
||||
list: ListInput
|
||||
): Task
|
||||
@bb_resolver(
|
||||
_type: UPDATE,
|
||||
_object: Task,
|
||||
_filter: { id: { _eq: "$id" } },
|
||||
_fields: {
|
||||
title: "$title",
|
||||
description: "$description",
|
||||
completed: "$completed",
|
||||
list: { id: "$list.$id" }
|
||||
})
|
||||
|
||||
deleteTask(id: ID!): Task
|
||||
@bb_resolver(
|
||||
_type: DELETE,
|
||||
_object: Task,
|
||||
_filter: { id: { _eq: "$id" }})
|
||||
|
||||
}
|
Reference in New Issue
Block a user