graphql

Dave Goodchild 2019-06-26T14:55:41.033900Z

Hi all

Dave Goodchild 2019-06-26T14:55:51.034200Z

I started learning Clojure TODAY

😃 2
Dave Goodchild 2019-06-26T14:56:26.035100Z

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

Dave Goodchild 2019-06-26T14:57:25.036300Z

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?

Dave Goodchild 2019-06-27T15:59:10.043100Z

sec

Dave Goodchild 2019-06-27T15:59:46.043300Z

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 Goodchild 2019-06-27T16:02:17.043500Z

did that work for you

Dave Goodchild 2019-06-27T16:02:22.043700Z

you mean

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

Dave Goodchild 2019-06-27T16:02:24.043900Z

still not joy

Dave Goodchild 2019-06-27T16:03:59.044100Z

and that looks out of whack with their docs

Dave Goodchild 2019-06-27T16:04:00.044300Z

https://lacinia.readthedocs.io/en/latest/resolve/attach.html

Dave Goodchild 2019-06-27T16:18:58.044700Z

holy cow got it working

Dave Goodchild 2019-06-27T16:19:31.044900Z

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 Goodchild 2019-06-27T16:19:45.045100Z

but failed silently as I allowed it to

2019-06-27T16:27:28.045300Z

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!

2019-06-27T16:27:59.045500Z

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

Dave Goodchild 2019-06-27T16:45:44.045700Z

maybe

Dave Goodchild 2019-06-27T16:45:51.045900Z

was tough to figure out

Dave Goodchild 2019-06-27T18:57:35.046300Z

now to get it resolving HTTP requests

2019-06-26T16:32:33.037Z

The default location for lacinia-pedestal is <http://localhost:8888>, can you at least see an empty GraphiQL?

Dave Goodchild 2019-06-26T16:43:06.037200Z

I can indeed

Dave Goodchild 2019-06-26T16:43:13.037400Z

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

Dave Goodchild 2019-06-26T16:43:35.037700Z

no doc explorer etc

Dave Goodchild 2019-06-26T16:44:01.037900Z

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

Dave Goodchild 2019-06-26T16:44:31.038100Z

thanks for your help in advance

Dave Goodchild 2019-06-26T16:49:24.038300Z

Dave Goodchild 2019-06-26T16:49:38.038700Z

2019-06-26T18:01:26.039200Z

Hmm that is very strange

Dave Goodchild 2019-06-26T20:25:44.039700Z

Does the code look reasonable?

2019-06-26T20:52:51.039900Z

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

2019-06-26T20:59:13.040100Z

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

Dave Goodchild 2019-06-26T21:29:20.040400Z

Nope

Dave Goodchild 2019-06-26T21:29:23.040700Z

Curled it

Dave Goodchild 2019-06-26T21:29:34.041100Z

Same kind of issue

Dave Goodchild 2019-06-26T21:29:48.041700Z

Frustrating as I was almost there on my own

Dave Goodchild 2019-06-26T21:30:00.042200Z

Hello world wasn’t gonna cut it

Dave Goodchild 2019-06-26T21:30:11.042600Z

Oh and good to meet you!

🙂 1