Just to clarify, you're not using the mutation response data? I was hoping to, instead running a separate query.
I don’t use it directly, but I believe apollo does
Seems it would be more efficient, esp, if your mutation can respond with all the data you need to render.
apollo keeps a normalized cache of the data returned from the GraphQL endpoint, and will update queries that are observing it when one of their data dependencies change (e.g. from a mutation) from the cache
Also, I might need at least the _id to allow running the separate query.
I think that we don’t take advantage of that too much since our mutations are kind of weird.
I followed the example in the gist, but I’m getting an error that the query
prop is undefined for some reason
(defnc concept-select [_]
[apollo/Query {:query (gql "{ concepts { id } }")}
(fn [result]
(let [{:keys [data error loading]} (j/lookup result)]
(cond
loading [:div "loading..."]
error [:p "uh oh..."]
:else [:p "it works"])))])
are you using the latest version of hx
? I had a bug that I pushed a fix for that I discovered in implementing that gist :P
it should be 0.5.1
that did it! thanks 🙏