Fork me on GitHub
#datascript
<
2017-07-10
>
myguidingstar03:07:45

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

kurt-o-sys06:07:41

in Datomic: https://github.com/danscan/datomic-graphql similar in Datomic: http://docs.caudate.me/adi/ 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 https://vimeo.com/77199361 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.

hmaurer10:07:23

qsys: Hahaha this talk on Narcissistic design is brilliant

kurt-o-sys11:07:48

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

hmaurer10:07:48

@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

hmaurer10:07:06

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

kurt-o-sys10:07:24

nope, not nonsense at all.

kurt-o-sys10:07:01

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

kurt-o-sys10:07:37

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

kurt-o-sys10:07:24

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

hmaurer10:07:28

@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”

hmaurer10:07:37

Although that’s hardly an argument in favor of GraphQL

kurt-o-sys10:07:49

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

kurt-o-sys10:07:11

Datascript is much more free...

hmaurer10:07:41

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

hmaurer10:07:52

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

hmaurer10:07:06

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

kurt-o-sys10:07:25

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)?

kurt-o-sys10:07:43

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

hmaurer10:07:45

Yep that makes sense