New to react and AWS. Have setup a new api project using amplify-cli. I need a public API (unauthenticated). So, I setup amplify with amplify configure + init & added api and auth, set it up for unauthenticated access. This is my schema:
id: ID!
deviceID: String!
location: Location!
expiration: AWSTimestamp!
}
type Location {
lon: Float!
lat: Float!
}```
I did push this successfully, however, whenever I call it from the react client using:
await API.graphql({
query: mutations.createMeditationLocation,
variables: {
input: {
deviceID: deviceID,
location: { lat: 1.5, lon: 1.5 },
expiration: expiration,
},
},
authMode: GRAPHQL_AUTH_MODE.AWS_IAM,
});
Im getting 'WARN [WARN] 01:32.394 GraphQLAPI - ensure credentials error No Cognito Identity pool provided for unauthenticated access'
When I go to the GrapQL API Console and try to run this query:
query MyQuery {
listMeditationLocations {
items {
deviceID
}
}
}
I get: Not Authorized to access listMeditationLocations on type Query as error message.
Any pointers on how to solve this problem? Thanks in advance!