This gist is an extracted test case to show how sorting by timestamps in a recursive query in dgraph does not return the expected results.
Dgraph version : v0.7.7
Commit SHA-1 : e065d29
| type Thing struct { | |
| Text string | |
| Things []Thing | |
| } | |
| func RootHandler(rw http.ResponseWriter, req *http.Request) { | |
| tmpl, err := template.New("root").Parse(` | |
| <html> | |
| {{ define "message" }} | |
| <li>{{ .Text }} |
| ([*('A'..'Z'),*('0'..'9')]-%w(0 1 I O)).sample(9).each_slice(3).map(&:join).join('-') |
| # When using heredocs in Ruby 2.3.0, use a tilde (~) instead of a minus (-) | |
| # to remove leading whitespace while keeping indentation in the doc itself. | |
| module I | |
| module AM | |
| module INDENTED | |
| OLD = <<-END | |
| <head> | |
| <title>Hello World</title> | |
| </head> |
| class C | |
| class << self | |
| def green(s) | |
| "\e[36m#{s}\e[0m" | |
| end | |
| def orange(s) | |
| "\e[33m#{s}\e[0m" | |
| end |
| Request timeout for icmp_seq 176 | |
| Request timeout for icmp_seq 177 | |
| Request timeout for icmp_seq 178 | |
| Request timeout for icmp_seq 179 | |
| Request timeout for icmp_seq 180 | |
| Request timeout for icmp_seq 181 | |
| Request timeout for icmp_seq 182 | |
| Request timeout for icmp_seq 183 | |
| Request timeout for icmp_seq 184 | |
| Request timeout for icmp_seq 185 |
| /* | |
| _.move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable() | |
| */ | |
| _.mixin({ | |
| move: function (array, fromIndex, toIndex) { | |
| array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] ); | |
| return array; | |
| } | |
| slug = text.downcase.gsub(/(ä|Ä|ö|Ö|ü|Ü|ß| |\?|\!)/, { | |
| 'ä' => 'ae', | |
| 'Ä' => 'ae', | |
| 'ö' => 'oe', | |
| 'Ö' => 'oe', | |
| 'ü' => 'ue', | |
| 'Ü' => 'ue', | |
| 'ß' => 'ss', | |
| ' ' => '-', | |
| '?' => '', |
| let arguments = { someId: "1234" } | |
| graphql(schema, query, null, arguments) |