hey everyone had a question. how do access the dat...
# orm-help
g
hey everyone had a question. how do access the data that is returned from inside one of my resolvers I user in my clientState. For example, I call a mutation that does a mutation, and I return and id. How does the react component that calls it grab that value? I see a promise getting returned.
k
Caveat: I'm not an expert. Are you using Apollo in your client? If you're just getting a promise you'll need to wait for the promise to resolve. If you can make the react function that gets fired by a click (or whatever action that causes the mutation to get performed)
async
you can
await
. For example: https://github.com/TreeAntSan/javrater-webapp/blob/master/client/src/components/movie/MovieEditor.js#L196 The mutation
addMovie
is composed here: https://github.com/TreeAntSan/javrater-webapp/blob/master/client/src/components/movie/Movie.js#L84