update to new syntax

This commit is contained in:
Markus Thielen 2023-04-20 10:41:14 +02:00
parent e32e5e7805
commit 50abd4d7b2

View File

@ -38,7 +38,7 @@ type Query {
"""
getUser(
username: String!
): User @bb_resolver(_type: select, _object: User, _filter: { username: { _eq: "$username" } })
): User @bb_resolver(_type: SELECT, _object: User, _filter: { username: { _eq: "$username" } })
}
@ -47,19 +47,19 @@ type Mutation {
createUser(
username: String!,
name: String!
): User @bb_resolver(_type: insert, _object: User, _fields: { username: "$username", name: "$name" })
): 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
): List @bb_resolver(_type: insert, _object: List, _fields: { title: "$title", user: "$user" })
): List @bb_resolver(_type: INSERT, _object: List, _fields: { title: "$title", user: "$user" })
updateList(
id: ID!,
title: String!
): List @bb_resolver(_type: update, _object: List, _filter: { id: { _eq: "$id" } }, _fields: { title: "$title" })
): 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" } })
deleteList(id: ID!): List @bb_resolver(_type: DELETE, _object: List, _filter: { id: { _eq: "$id" } })
createTask(
title: String!,
@ -67,7 +67,7 @@ type Mutation {
completed: Boolean!, # default not implemented yet, this needs to be added as it's non-nullable
list: List! # list needs to be specified as it's non-nullable
user: User! # username needs to be specified as it's non-nullable
): Task @bb_resolver(_type: insert, _object: Task, _fields: { title: "$title", description: "$description", completed: "$completed", list: "$list", user: "$user" })
): Task @bb_resolver(_type: INSERT, _object: Task, _fields: { title: "$title", description: "$description", completed: "$completed", list: "$list", user: "$user" })
updateTask(
id: ID!,
@ -75,8 +75,8 @@ type Mutation {
description: String,
completed: Boolean,
list: List
): Task @bb_resolver(_type: update, _object: Task, _filter: { id: { _eq: "$id" } }, _fields: { title: "$title", description: "$description", completed: "$completed", list: "$list" })
): Task @bb_resolver(_type: UPDATE, _object: Task, _filter: { id: { _eq: "$id" } }, _fields: { title: "$title", description: "$description", completed: "$completed", list: "$list" })
deleteTask(id: ID!): Task @bb_resolver(_type: delete, _object: Task, _filter: { id: { _eq: "$id" } })
deleteTask(id: ID!): Task @bb_resolver(_type: DELETE, _object: Task, _filter: { id: { _eq: "$id" } })
}