Created
December 17, 2018 23:01
-
-
Save adrianhall/e97ead2c6d742d49fc6f9afb5481925b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async componentWillMount() { | |
try { | |
const result = await API.graphql(graphqlOperation('{ me { id name } }')); | |
console.log('componentWillMount: result = ', result); | |
this.setState({ loading: false, data: result.data.me }); | |
} catch (err) { | |
this.setState({ loading: false, errors: [ err.message ] }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment