This commit is contained in:
2023-03-07 22:12:06 +01:00
parent ae400722ba
commit 896ca59ace
15 changed files with 248 additions and 14 deletions

View File

@ -24,17 +24,17 @@ modify_table = ["Task", ""]
modify_values = [["title", "'$title'"], ["description", "'$description'"], ["completed", "$completed"], ["list_id", "'$list.$id'"]]
aggregate_final_json_result = true
[resolvers.getUser]
operation_name = "getUser"
[resolvers.createUser]
operation_name = "createUser"
[resolvers.getUser.resolver]
command_type = "SQLSelect"
[resolvers.createUser.resolver]
command_type = "SQLInsert"
columns = []
tables = [["User", ""]]
where_clauses = [["User", "username", "= '$username'"]]
tables = []
where_clauses = []
join_clauses = []
modify_table = ["", ""]
modify_values = []
modify_table = ["User", ""]
modify_values = [["username", "'$username'"], ["name", "'$name'"]]
aggregate_final_json_result = true
[resolvers.createList]
@ -62,3 +62,16 @@ join_clauses = []
modify_table = ["Task", ""]
modify_values = [["title", "'$title'"], ["description", "'$description'"], ["completed", "$completed"], ["list_id", "'$list.$id'"], ["user_username", "'$user.$username'"]]
aggregate_final_json_result = true
[resolvers.getUser]
operation_name = "getUser"
[resolvers.getUser.resolver]
command_type = "SQLSelect"
columns = []
tables = [["User", ""]]
where_clauses = [["User", "username", "= '$username'"]]
join_clauses = []
modify_table = ["", ""]
modify_values = []
aggregate_final_json_result = true

View File

@ -4,7 +4,7 @@ log_level = "trace"
[graphql]
# path and file name to GraphQL schema file
schema_file = "todo5_schema.graphql"
schema_file = "todo_schema.graphql"
[proxy]
# host name or IP of basebox DB proxy

3
bbconf/compile_schema.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
# Run basebox installer from the samples/toodo/bbconf directory
cargo run --manifest-path ../../../installer/Cargo.toml -- -c install-config.toml

View File

@ -20,7 +20,7 @@ acc_aud = "account"
[graphql]
# path and file name to GraphQL schema file
schema_file = "todo5_schema.graphql"
schema_file = "todo_schema.graphql"
# Path and file name of the resolver map file
resolver_map_file = "bb_todo_resolvers.toml"
# Path and file name of the type map file

View File

@ -0,0 +1,18 @@
# Sample toml file; for testing only
[generic]
# the name of the project
project_name = "bb_todo"
# the folder where the generated files will be placed. If not specifed, the project name will be
# used to create a folder by that name in the current directory. Note that the folder must not exist
# yet in order to make ensure that an existing installation will not be overwritten by accident.
output = "output"
[log]
# log level; can be off, error, warn, info, debug, trace
log_level = "info"
[graphql]
schema = "todo_schema.graphql"
[database]

View File

@ -44,6 +44,11 @@ type Query {
type Mutation {
createUser(
username: String!,
name: String!
): User @bb_resolver(_type: insert, _object: User, _fields: { username: "$username", name: "$name" })
createList(
title: String!
user: User! # username needs to be specified as it's non-nullable