Slash GraphQL - Define Schema in DQL

Hi Team,

Schema definition in GraphQL lacks a few features for example @count Add @count to GraphQL schemas and queries and others.

image

It would be better therefore to be able to use the full power of Dgraph and assign our indices directly on the schema. Since this is not fully supported, is there:

  1. Any way to define the schema in DQL instead of GraphQL?

  2. Any way to define the schema in DQL on one end and the queries and mutations in GraphQL on the other (I’m thinking of Custom DQLs from GraphQL which would not be possible if defining the schema only in DQL), things like:

queryNoteListSummary(noteId: ID!): [NoteListSummary] @custom(dql:"""

  1. Is all of the above doable from Slash GraphQL dashboard or not at all?

Thank you Team!

You can programatically access Slash using things like dgo. Then you can just do all that. You do lose the frontend niceness though and the autogenerated queries.

For the most part. I believe in flexible mode you have Ratel access through Slash for managing the underlying DQL schema and the query playground for DQL. In the GraphQL schema editor in Slash you can create custom queries to DQL. It is limited to queries only and not mutations at this time. Lambda functions on Slash should be hitting pretty soon which will really add a lot of features that will fill the gaps.

One thing to keep in mind though is that you can quickly break your graphql endpoint by modifying schema or data using DQL. Proceed at your own risk, lol. It is almost like a SQL server giving you access to the underlying file system to change files as you please. You could use it for good or you could really do harm.

What I try to do is keep as much as possible in graphql and then use a lambda function if absolutely necesaary