Fork me on GitHub
#graphql
<
2019-06-26
>
Dave Goodchild14:06:51

I started learning Clojure TODAY

😃 8
Dave Goodchild14:06:26

and I like to learn by building, so am porting a GraphQL server we have at work (Node) into Clojure with Lacinia etc

Dave Goodchild14:06:25

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?

jvtrigueros16:06:33

The default location for lacinia-pedestal is , can you at least see an empty GraphiQL?

Dave Goodchild16:06:13

"but when I boot GraphiQL the schema isn't available,"

Dave Goodchild16:06:35

no doc explorer etc

Dave Goodchild16:06:01

when I run the functions in the REPL I get a compiled schema and the EDN is in the classpath etc

Dave Goodchild16:06:31

thanks for your help in advance

jvtrigueros18:06:26

Hmm that is very strange

Dave Goodchild20:06:44

Does the code look reasonable?

jvtrigueros20:06:51

It does, is the only thing not working is the code introspection? That is can you make graphql queries through a client?

jvtrigueros20:06:13

Once I'm free I'll try to execute this code.

Dave Goodchild21:06:34

Same kind of issue

Dave Goodchild21:06:48

Frustrating as I was almost there on my own

Dave Goodchild21:06:00

Hello world wasn’t gonna cut it

Dave Goodchild21:06:11

Oh and good to meet you!

🙂 4
jvtrigueros06:06:47

Flip the arguments of attach-resolvers 🙂

Dave Goodchild15:06:46

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

Dave Goodchild16:06:17

did that work for you

Dave Goodchild16:06:22

you mean

(attach-resolvers {get-content :get-content}
?

Dave Goodchild16:06:59

and that looks out of whack with their docs

Dave Goodchild16:06:58

holy cow got it working

Dave Goodchild16:06:31

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

Dave Goodchild16:06:45

but failed silently as I allowed it to

jvtrigueros16:06:28

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!

jvtrigueros16:06:59

Yeah I don't know why it succeeds silently, it might be by design.

Dave Goodchild16:06:51

was tough to figure out

Dave Goodchild18:06:35

now to get it resolving HTTP requests