WorksHub / leona

spec -> lacinia schema
Eclipse Public License 1.0
36 stars 17 forks source link

Some work on #4 (s/fdef parsing) and #11 (description support), #37

Closed tolgraven closed 5 years ago

tolgraven commented 5 years ago

Both functional but in need of design decisions before some further work and cleanup. And tests... There are definitely all-around better approaches with less mess - while I'm weak with macros completely avoiding them when they're around is even harder. And multiple arity doesn't really count if you gotta watch quoting your input... fdef oughta be separate and macro'd so the main fns don't get polluted, hence fdef stuff already in its own fn. Well that and the duplication between queries and mutations. Then subscriptions I suppose? These should probably share a common setup entrypoint.

The fdef parsing is real hacky since it has to try to conform to the other arity, and having multiple sources of automagically injected truth seems ripe for mess.

tolgraven commented 5 years ago

Alright, less inconsequential rambling more action. Macros externally, passing to internal fn. All that needs to be done is decide a naming convention for regenerated parsed specs - current :args and :ret as namespaces obviously silly, original should be preserved but doing that you end up losing the proper name for differentiation. Then again that's all internal and not exposed to queries so eh dunno.

tolgraven commented 5 years ago

Ouch just realized the reason I was awkwardly using fn name instead of ret was some attempt at being able to reuse return specs without overwriting other queries. But then that's what happens anyways with how you've set things up, so changing or working around that is a whole other scope... but seems rather important in general?

This seemed like perfect timing to work on as currently trying to understand lacinia internals better, but it's just making me more confused, not less hehe.

Honestly don't know what cracks me up more, the sheer amount of dunning-kruger or the blind automatism of returning to it twice, seeing it makes no sense but not reflecting on how. Disregard it all, obviously! :D hope it brings you's a good laugh, ill be back.