0

I am using Dgraph and Postgres as my databases. I am using elixir with ecto to handle the graphql implementation from the frontend to the postgres db. I now need to map graphql queries to dgraph's version of graphql (graphql+-) so that I can use the power of graphql to get only the data I need. Is the best way to map graphql to graphql+- and how would you even do that? or is there another way to do it. I have tried to pass graphql queries directly to dgraph but as you can imagine that doesn't work. Is there another way that I haven't thought about?

Errol Hassall
  • 398
  • 3
  • 16

1 Answers1

1

At this moment, I don't think so. GraphQL+- doesn't support all of GraphQL featues, so you'll have to write a transformer from GraphQL to GraphQL+-.

From official docs:

We’ve modified the language to better support graph operations, adding and removing features to get the best fit for graph databases.

Ondrej Slinták
  • 31,386
  • 20
  • 94
  • 126
  • Yeah thats what I was afraid of, would the best way be to map json to json. eg. graphql query, send to transformation which modifies it slightly to fit graphql +- then do the opposite on the way back? – Errol Hassall Mar 30 '18 at 20:06
  • I'm not too familiar with GraphQL so I'm not sure about the actual differences between it and GraphQL+-, but I don't think you have many other choices. It of course depends on context of your aplication. – Ondrej Slinták Mar 31 '18 at 20:59
  • Thanks, I guess I'll stick the mapping idea. Thanks – Errol Hassall Apr 02 '18 at 21:42