I have this query:
export const queryUserById = async (id: string) => { let result = await API.graphql<GraphQLQuery<GetUserQuery>>( graphqlOperation(getUser, { id, } as GetUserQueryVariables, ) ) return result.data.getUser }
The problem is, when i query another user, it says "Not Authorized to access customer_number on type User" and it throws an error.
This is my schema for it:
customer_number: String @auth( rules: [ { allow: owner, operations: [read, create] } { allow: public, provider: apiKey } ] )
How do i avoid this error? The field is null how its supposed to be