Hi all
I started learning Clojure TODAY
and I like to learn by building, so am porting a GraphQL server we have at work (Node) into Clojure with Lacinia etc
got pretty far and can verify most of what I have via the REPL, but when I boot GraphiQL the schema isn't available, I know the schema is being compiled from my EDN file fine, wondered if someone could give me a pointer at all?
sec
LOL in the example I saw it was using threaded macros but I need to pass an argument to the edn readstring function so rewrote it
did that work for you
you mean
(attach-resolvers {get-content :get-content}
?still not joy
and that looks out of whack with their docs
https://lacinia.readthedocs.io/en/latest/resolve/attach.html
holy cow got it working
unwound it back to threaded macros and added a try - and there is an extraneous set of parens in the schema so it didn't compile after all
but failed silently as I allowed it to
Sorry, yeah it was that function, the threaded macro passes in the result of the previous function into the first arg of the next function, you had it in unthreaded form, but had the arguments flipped. I'm glad you got it working!
Yeah I don't know why it succeeds silently, it might be by design.
maybe
was tough to figure out
now to get it resolving HTTP requests
https://github.com/buddhamagnet/clj-graphql/blob/master/src/gql/core.clj
The default location for lacinia-pedestal is <http://localhost:8888>
, can you at least see an empty GraphiQL?
I can indeed
"but when I boot GraphiQL the schema isn't available,"
no doc explorer etc
when I run the functions in the REPL I get a compiled schema and the EDN is in the classpath etc
thanks for your help in advance
Hmm that is very strange
Does the code look reasonable?
It does, is the only thing not working is the code introspection? That is can you make graphql queries through a client?
Once I'm free I'll try to execute this code.
Nope
Curled it
Same kind of issue
Frustrating as I was almost there on my own
Hello world wasn’t gonna cut it
Oh and good to meet you!