dabit3 / react-appsync-graphql-recipe-app Goto Github PK
View Code? Open in Web Editor NEWExample application using React + AWS AppSync + GraphQL
Example application using React + AWS AppSync + GraphQL
I am following this link https://tylermcginnis.com/building-serverless-react-graphql-apps-with-aws-appsync/ and completed upto my request part.
Request:
query listRecipes { listRecipes { items { id name instructions ingredients } } }
Error:
{ "data": { "listRecipes": { "items": [ null ] } }, "errors": [ { "path": [ "listRecipes", "items", 0, "ingredients" ], "data": null, "errorType": "DynamoDB:AmazonDynamoDBException", "errorInfo": null, "locations": [ { "line": 7, "column": 7, "sourceName": null } ], "message": "The provided key element does not match the schema (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: VV5MALU6PKQM3L0Q3UF937Q2LJVV4KQNSO5AEMVJF66Q9ASUAAJG)" }, { "path": [ "listRecipes", "items", 0, "name" ], "data": null, "errorType": "DynamoDB:AmazonDynamoDBException", "errorInfo": null, "locations": [ { "line": 5, "column": 7, "sourceName": null } ], "message": "The provided key element does not match the schema (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: EIOBAUHUARVV0VTF5MI7SR8HJ3VV4KQNSO5AEMVJF66Q9ASUAAJG)" }, { "path": [ "listRecipes", "items", 0, "instructions" ], "data": null, "errorType": "DynamoDB:AmazonDynamoDBException", "errorInfo": null, "locations": [ { "line": 6, "column": 7, "sourceName": null } ], "message": "The provided key element does not match the schema (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: NBTF9ANE157BIL171QD2ATQIJFVV4KQNSO5AEMVJF66Q9ASUAAJG)" } ] }
After running createRecipe
in the AWS console, the web UI fails to rerender with an updated list. Instead, a warning is flagged in the console and nothing is rendered (blank/empty). On refresh, each recipe is listed, including the newly created recipe, as they should be.
Here is the console output:
Missing field instructions in {
"id": "new_id",
"__typename": "Recipe"
}
Stack:
I get an error about a missing compose function from Recipes.js. Looks like just removing that function gets things to build and run and more closely matches the article.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.