Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created April 19, 2019 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/e0d893f74ffa8e393ceb5fa64adf61f6 to your computer and use it in GitHub Desktop.
Save amandeepmittal/e0d893f74ffa8e393ceb5fa64adf61f6 to your computer and use it in GitHub Desktop.
// App.js
// ... after other imports
import { listNotes } from "./graphql/queries"
// ... inside App component
async componentDidMount() {
const result = await API.graphql(graphqlOperation(listNotes))
this.setState({ notes: result.data.listNotes.items })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment