"Not Authorized to access on type" error when accessing output from Custom Query, Mutation

0

I created several custom mutations and queries as below and set their output to non-@model type.

type someOutput {
  a : Int
  b: String
}

type Mutation {
  someMutation(
    input: someInput!
  ): someOutput 
    @function(name: "lambdafunction-${env}")
    @auth(rules: [{
      allow: private
    }])
}

When I test this in AppSync, a "Not Authorized to access on type" error occurs.
I couldn't solve it by setting globalAuthRule to public. It can be solved by granting field-level authorization to all fields.
Is there any way to grant permission to non-@model type without using field level authorization? Or should I write the schema some other way?
I am very confused because I have used schema written in the same way in other projects and used it well.

1回答
0
承認された回答

Solution here.

type someOutput @aws_cognito_user_pools {
  a : Int
  b: String
}
gerrard
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ