Skip to content
Advertisement

How to use the GraphQL Get query from aws in React

I’m trying to make use of the getquery for graphql in react.js. But I can’t figure out how to go about doing this. I already succeeded to use the list query.

JavaScript

How does one go about using the get query? Thanks!

Advertisement

Answer

You need an ID to retrieve an item with any get query. getPatient(id:”YOUR ID HERE”){}`

Something like…

JavaScript

For React, you’ll add in the id to the variables list argument:

JavaScript

docs: https://aws-amplify.github.io/docs/js/api#simple-query

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement