| ▲ | Biff.graph: structure your Clojure codebase as a queryable graph(github.com) | |||||||||||||||||||||||||
| 98 points by jacobobryant 4 days ago | 9 comments | ||||||||||||||||||||||||||
| ▲ | geokon an hour ago | parent | next [-] | |||||||||||||||||||||||||
It's very cool you managed to make a mini Pathom - esp in so few lines of code :)) But the end result looks almost identical? Resolver declarations are a bit reorganized and look a bit cleaner - though you could do that with a wrapper around Pathom. Why not fork Pathom and just make some QOL adjustments? If you are okay only having a subset, then I think you could streamline Pathom quite a bit more.. Off the top of my head: - adding and "registering" resolvers in to an environment is always annoying. To me this feels like it should be abstracted away and you should never has to manage this stuff. Each time you add a resolver you have to copy the new resolver name, scroll down to the bottom of the file and paste it in to the resolver list. Stale resolvers floating around in the ns and forgetting to register resolvers regularly leads to weird scenarios where you're wondering why something isn't resolving. I think the user shouldn't really have to think about any of this.. the environment should be constructed automatically by the engine. Scan the namespace and register ever resolver. I get that it'd be not as flexible this way.. but I've never had to make multiple environments in one namespace. - You should be able to safely reregister resolvers. This happens when you try to decouple sub-systems that depend on common resolvers. Ex: I have some utility resolvers that do some format conversions. If I add them to the environments of two namespaces, then those two namespaces can't be registered in a parent namespace. It's not a dealbreaker, you just register all your ns environments all the top-level and do all your queries there. But you can't add inline test queries in these lower level namespaces and it sort of breaks the decoupling (esp if it's across library boundaries). - The Pathom errors are actually pretty good once you know how to read them (but there is a ton of visual noise). My guess is it's going to be a challenge to get to the same level in a rewrite. It feels like there is room for improvement here, but I don't have concrete ideas. Maybe a ASCII diagram of the chain of missing keys? There is Pathom-Viz, but from what I understand it doesn't handle nested queries (which in a not-toy program will be basically all your queries) | ||||||||||||||||||||||||||
| ▲ | chamomeal 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
> biff.graph is basically a lightweight version of Pathom. It implements only a subset of Pathom's functionality with the intention of being easier to understand. I’ve heard of pathom but I’ve never actually dove in and tried it out. It sounds super neato though. I have a bunch of microservice DB’s (that should really just be on DB, but I think we’re created in the peak of microservices hype). I def need a better way to explore the data. “Easier to understand” sounds sick and I think I’ll check it out this week! | ||||||||||||||||||||||||||
| ▲ | adamfeldman 9 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
There are a few great talks on YouTube by the creator of Pathom explaining the value of the graph: https://m.youtube.com/watch?v=IS3i3DTUnAI | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | Capricorn2481 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
My experience with Pathom, and other graph query libraries, is it feels like a deliberately confusing way to reason about a program. I'd like to know your thoughts on it. From what I hear, the main draw is separating what you want from how you get it, so your calling code can just focus on what it needs. But you can use regular functions to do that. What libraries like Pathom do is leave it open to the caller what shape of data they need. But I think letting the caller do subtle query changes that can completely change which resolvers are triggered and how something is fetched is kinda leaky. How do you write the perfect resolver for all situations? How do you keep them from accidentally exploding their fetches? Is it not better to have things be explicit through function calls instead of chasing down disjointed call graphs? | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | tosti 7 hours ago | parent | prev [-] | |||||||||||||||||||||||||
The name suggests it plots graphs related to incoming email. | ||||||||||||||||||||||||||