oliyh / superlifter

A DataLoader for Clojure/script
Eclipse Public License 1.0
178 stars 12 forks source link

Avoiding macros and the global registry? #20

Closed vvvvalvalval closed 2 years ago

vvvvalvalval commented 3 years ago

Is there a way to not go through macros and a global registry when defining fetchers?

I see this as problematic for cases where you'd generate your GraphQL handlers at runtime, e.g in the spirit of https://vvvvalvalval.github.io/posts/2018-07-23-datascript-as-a-lingua-franca-for-domain-modeling.html

If it's not possible, I would suggest to at least document it explicitly, because it might be a deal-breaker for some use cases.

oliyh commented 3 years ago

Hi,

It is absolutely possible, a fetcher just needs to implement urania.core/Datasource (and optionally BatchedSource if it supports batching). The macros included in superlifter are just for convenience to remove a bit of boilerplate for common use cases.

oliyh commented 2 years ago

Going to close this as I think the question was answered