Have an option to add custom grpc go example in the runnable shortcode

Posted by pawanrawal:

For mutations and some other examples (see below), its not possible or ideal to use the SetQuery template so we should probably have an option to write custom Golang grpc code.

  1. For e.g. - https://docs.dgraph.io/v0.7.6/query-language/#graphql-variables - The example here should use SetQueryWithVariables
  2. For mutations, could we have a runnable which doesn’t actually have the Run button so that we can still show how it can be done with the client and Golang http? If we have it then we would need to add custom grpc code for mutations.

MichaelJCompton commented :

Might be nice if we could extract the examples out of the markdown document. Each example could be held in a text file and something is run over them to include the appropriate content in the doc - maybe some flags to indicate what the example requires, or if it is actually runnable or just example.

Then we could attach some testing to the example files, so that for each update, we’ll know if we broke any examples.