Fork me on GitHub

I'm just curious... anyone here have experience making Datascript work with Graphql? Or does the combination make sense?


in Datomic: similar in Datomic: To me, * I don't see the point of using graphql client-side/in-browser * serverside, there might be a use case, but graphql is much more limited than edn-queries (edn = unlimited types, reverse lookups, ...), but it could work, though. I'm trying out datascript serverside now (adding durability), and the api is: send edn queries. This is more or less the idea of that adi library. There's a talk of Stuart Halloway about 'how to screw other devs' (or 'how to make money as a consultant') - the title is different, but that's what it's about more or less, in a very sarcastic way. One of his points is: the DSL - see arount 8:02. I'm inclined to share the information model, which is just the schema (well, in Datomic, there's a restricted schema restriction, you can do the same in Datascript and put some validation on it). GraphQL is just another abstraction of that information model, having less power than datalog-queries. But again, there may be use cases where it's useful.


qsys: Hahaha this talk on Narcissistic design is brilliant


yeah, and the real genius here is: it's even true 🙂


@kurt-o-sys is it really compeltely fair to compare datalog and graphql though? datalog works as a query engine for a database, whereas graphql is an abstraction that can query any data source


(disclaimer: I know very little about Datalog so I might be spitting out complete nonsense)


nope, not nonsense at all.


Graphql is another abstraction. When it comes to datascript, though, I don't see much added value of an extra layer of abstraction


Although, there may be use cases where it's valuable.


you may think of a datalog abstraction for another db as well.


@kurt-o-sys that’s true… it’s also worth noting that GraphQL has a statically typed schema, which is very valuable. The same can be done Datomic/Datascript with extra attributes specifying a schema but it’s not “built-in”


Although that’s hardly an argument in favor of GraphQL


well, in Datomic, there is a scheme...


Datascript is much more free...


The datomic schema doesn’t specify what attributes are allowed on an entity though. It only specify which attributes exist, and you may attach them to any entity


When communicating with a backend you might want a bit more specification than that


(which can be done on datomic, it’s just not the default)


True, but than again, the attributes you define are usually namespaced, so you define a kind of composable mixins (a bit like graphql interfaces?) for entities. Not sure if that makes sense 😛. Anyway, the namespaces attributes are somewhat like concepts, which can be composed to construct an entity (does that make any sense)?


I had issues defining entities in an elegant (composable) way for quite some business cases using types.


Yep that makes sense