Adding Schema in Slash GraphQL

During Graph in Space streaming, I was told by several members of Dgraph that Slash also accepts GraphQL± syntax, but when I try to paste my “init DB” script, it doesn’t work:

type Asset {
	a_acquired
	<~a_reminders>
	...
	a_created_at
}

type Money {
	o_amount
	o_currency
}

...

<a_acquired>: datetime @index(day) .
<a_reminders>: [uid] @reverse .
...
<a_created_at>: datetime @index(day) .

<o_amount>: int @index(int) .
<o_currency>: string @index(exact) .

...

How do I make it happen without changing my schema? It’s always been working for the on-prem version (Dgraph 1.x and 20.x).

Hey @wiradikusuma, welcome back.

So, you can use GraphQL± (now known as DQL) using your traditional connection methods to Slash (i.e. using gRPC, and dgo/pydgraph etc)

Another method of using DQL is to embed DQL in graphql using the @remote directives - see also the docs on custom DQL in GraphQL.

Other than this, you can also use ratel at play.dgraph.io. Just create a API token on the Slash Dashboard and enter it into ratel

1 Like

2 posts were split to a new topic: Connecting to Slash GraphQL using Dgraph4j