Fork me on GitHub
#graphql
<
2018-07-11
>
kwladyka13:07:13

please confirm if I am right. If I want give users possibility to download pdf file by API still I should use REST API. Is there alternative?

hlship14:07:52

Right. GraphQL doesn’t encompass file upload or download. Your schema should expose a field with the correct URL.

curtosis16:07:37

anyone know of an example of mapping lacinia resolvers to Datomic queries? It seems like it should be relatively straightforward, but seeing how someone else has tackled it would be a big help.

eraserhd16:07:04

Im doing it.

eraserhd16:07:27

The code is not public. I can show bits, though.

eraserhd16:07:25

My top-level queries return lists of entity-maps (e.g. #(d/entity db ref)), and the one field resolver are essentially (fn [context args container] (get container (datomic->graphql k)).

eraserhd16:07:44

er, graphql->datomic

eraserhd16:07:52

I'd love to make the code generic, but I think it's too tied to assumptions we make.

eraserhd16:07:16

I also have utilities for converting graphql to datomic attributes and back. Also with assumptions, unfortunately.

curtosis16:07:39

cool, and definitely understand about not really easily-shared code.

curtosis16:07:17

graphql->datomic is mapping gql specification to datalog?

eraserhd17:07:48

In this case, it's a stand in for "translate datomic keyword to graphql keyword"

eraserhd17:07:48

Our datomic attributes are, like, ":program/legacy-degree-offering". GraphQL does not allow dashes, slashes, or namespaces, and prefers camelCase, so we mechanically map it to ":legacyDegreeOffering".

eraserhd17:07:55

I'm hoping to rename the Datomic attributes to be things like :Program/legacyDegreeOffering over time, but this will require a lot of little bits of work.

curtosis17:07:41

ah, right. that makes sense.

curtosis17:07:18

to some extent I’m still wrapping my head around what’s in the resolver arguments besides args, so there’s that too.

timgilbert14:07:13

Let me know if you have questions about stillsuit, it's my company's project. We open-sourced it but haven't yet embarked on publicizing it. There's a good amount of docs here though: http://docs.workframe.com/stillsuit/current/manual/

eraserhd14:07:42

I'm not sure when I can look into it. Also, I kind of did a bunch of this, but maybe not in the same way, and I can't break compatibility for clients. I'd love for it to work out, though. I have been looking for reusable pieces to take out of our code, as the code base is getting large for my taste.

curtosis19:07:29

ah, excellent! looking now…

mynomoto19:07:59

What is the most straightforward way of adding extra routes using lacinia pedestal?

mynomoto19:07:02

I can conj on the set of routes after building the service map, but I'm wondering if it is exposed on the api somewhere.

hlship21:07:48

There was an example posted here a few days ago. conj is the way to go.

hlship21:07:04

When you have data, less API is better.

👍 4