"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.

gerrard
preguntada hace un año382 visualizaciones
1 Respuesta
0
Respuesta aceptada

Solution here.

type someOutput @aws_cognito_user_pools {
  a : Int
  b: String
}
gerrard
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas