From 570d40bb8216d809e00d9bed2cbb911eb84ce379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Wojtasik?= Date: Thu, 28 Jul 2022 08:00:59 +0200 Subject: [PATCH] Mark inbox commands with 'use' directive This is an example that shows how to use this directive. --- priv/graphql/schemas/admin/inbox.gql | 8 ++++---- priv/graphql/schemas/user/inbox.gql | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/priv/graphql/schemas/admin/inbox.gql b/priv/graphql/schemas/admin/inbox.gql index fdc6c4aad5..824e65858a 100644 --- a/priv/graphql/schemas/admin/inbox.gql +++ b/priv/graphql/schemas/admin/inbox.gql @@ -1,14 +1,14 @@ """ 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( @@ -16,7 +16,7 @@ type InboxAdminMutation @protected{ 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( @@ -24,5 +24,5 @@ type InboxAdminMutation @protected{ hostType: String!, "Remove older than given days or all if null" days: PosInt - ): Int @protected(type: GLOBAL) + ): Int @use(arg: "hostType") @protected(type: GLOBAL) } diff --git a/priv/graphql/schemas/user/inbox.gql b/priv/graphql/schemas/user/inbox.gql index 722180d5d4..763f97f859 100644 --- a/priv/graphql/schemas/user/inbox.gql +++ b/priv/graphql/schemas/user/inbox.gql @@ -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 }