Skip to content

Commit

Permalink
Mark inbox commands with 'use' directive
Browse files Browse the repository at this point in the history
This is an example that shows how to use this directive.
  • Loading branch information
Premwoik committed Jul 28, 2022
1 parent 27e3a34 commit 570d40b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions priv/graphql/schemas/admin/inbox.gql
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
"""
Allow admin to flush the inbox bin".
"""
type InboxAdminMutation @protected{
type InboxAdminMutation @use(modules: ["mod_inbox"]) @protected{
"Flush the user's bin and return the number of deleted rows"
flushUserBin(
"User to clear a bin"
user: JID!,
"Remove older than given days or all if null"
days: PosInt
): Int @protected(type: DOMAIN, args: ["user"])
): Int @use(arg: "user") @protected(type: DOMAIN, args: ["user"])

"Flush the whole domain bin and return the number of deleted rows"
flushDomainBin(
"Domain to be cleared"
domain: String!,
"Remove older than given days or all if null"
days: PosInt
): Int @protected(type: Domain, args: ["domain"])
): Int @use(arg: "domain") @protected(type: Domain, args: ["domain"])

"Flush the global bin and return the number of deleted rows"
flushGlobalBin(
"Required to identify the DB backend"
hostType: String!,
"Remove older than given days or all if null"
days: PosInt
): Int @protected(type: GLOBAL)
): Int @use(arg: "hostType") @protected(type: GLOBAL)
}
4 changes: 2 additions & 2 deletions priv/graphql/schemas/user/inbox.gql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Allow user to flush own inbox bin".
"""
type InboxUserMutation @protected{
type InboxUserMutation @use(modules: ["mod_inbox"]) @protected{
"Flush the user's bin and return the number of deleted rows"
flushBin(
"Remove older than given days or all if null"
days: PosInt
): Int
): Int @use
}

0 comments on commit 570d40b

Please sign in to comment.