@claym I've figured out the credentials. Thanks.
By chance, would you know what the apixxxGraphQLAPIEndpointOutput
env variable to should be when mocking the lambda function? I was having this issue: aws-amplify/amplify-cli#2453 and the last answer given seems to resolve the issue. However, I've tried adding http://[ip address]:20002
as the endpoint and it doesn't like the response. It gives me an unexpected token <
error...which probably means the endpoint is not correct.
amplify init
then amplify add auth
select your options, then amplify push
. Now you have the deployed stack with Auth setup. To keep this backend only, you would just not setup any of the frontend js libs, etc…
Hi,
I run a GraphQL mutation using the AWS AppSync Queries page. Now, the first time I try this mutation, everything works fine and the first time, but if I try to submit the mutation again without changing anything, I get an error...
This is my mutation:
mutation {
createStore(
input: {
storeName: "SomeStoreNYC",
geoLocation: {
latitude: 0.73,
longitude: 0.45
},
address: {
city: "New York",
country: "USA",
state: "NY",
address: "555 W 55th Street",
zipcode: "10010"
},
logoUrl: {
key: "logo-key",
bucket: "logo-bucket",
region: "usa-1"
},
phoneNumber: "999-999-3333"
}
){
id
}
}
This is the error that I get if I try the mutation above two times:
{
"data": {
"createStore": null
},
"errors": [
{
"path": [
"createStore"
],
"data": {
"id": "2c03a100-f992-4f20-a6db-799d98dc3d6c"
},
"errorType": "DynamoDB:ConditionalCheckFailedException",
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 5,
"sourceName": null
}
],
"message": "The conditional request failed (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ConditionalCheckFailedException; Request ID: A4NNQQ0SR2U23FSHO0EK7AM5BJVV4KQNSO5AEMVJF66Q9ASUAAJG)"
}
]
}
Any suggestions??
Thanks
amplify add api
CLI as an annotated schema. Everything setup in the backend. But, it doesn't look like auth is correct. The run schema is disabled after I login.
type Todo @model {
id: ID!
name: String!
description: String
}
and
type Todo @model @key(fields:["id"]){
id: ID!
name: String!
description: String
}
generate distinct listTodo
, createTodo
and deleteTodo
operations. That doesn't make any sense to me, they should be the same, right?
@key
directive doesn't have a name, then it specifies the primary key of the underlying table.id
, and the underlying dynamodb table Todo
is the same, but the graphql schema and resolvers that are generated by Amplify are different, which drives my spider-sense crazy