Closed nrakochy closed 7 years ago
Sorry, why can't you just turn all strings into keywords? Something like this (untested):
(def c (clojure.walk/postwalk (fn [x] (if (string? x) (keyword x) x))) (json/read-str b)
Also, graphql endpoints are suppose to support application/json: http://graphql.org/graphql-js/graphql-clients/.
Hey, I agree with decoursin, this is something that should be taken into consideration in your own code :)
Okay, sounds good. I do think there is a use case for requests coming across the wire for clients that have no concept of Graphql that could be converted by venia
directly. Nevertheless, I do appreciate the input. Thanks for the reply.
Hi there.
Thanks for the library. I am working on a server-side endpoint and was attempting to use
venia
to coerce an incoming json request to a graphql query. Is this feasible?Unfortunately I could not get this to work, as
venia
is specced out to use keywords rather than strings-Since calling
(keyword :example-key)
just returns the key, I tried updating spec & core with something like this to coerce the incoming stringbut to no avail. What changes might be needed to support a generic JSONified string (e.g.
(def b)
above)?