"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 Answer
0
Accepted Answer

Solution here.

type someOutput @aws_cognito_user_pools {
  a : Int
  b: String
}
gerrard
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions