Open positron opened 6 years ago
As far as I can tell, this feature is not implemented. You can use this ugly hack though
(defn inline-fragment
[type fields]
[(keyword (str "... on " (name type))) fields])
(comment
(require '[venia.core :as venia])
(venia/graphql-query {:venia/queries [[:hero {:episode :A_NEW_HOPE}
[:name
(inline-fragment :Droid [:primaryFunction])]]]})
;=> "{hero(episode:A_NEW_HOPE){name,... on Droid{primaryFunction}}}"
)
desired helper made available via https://github.com/Vincit/venia/pull/42/commits/fc786c911c9bb11920d83a40617816cb3867654f on #42
I don't think it is possible to render the
... on Droid
part of this query using what exists today.If I can, tell me how and I'll update the documentation if needed :-)