"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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인