I can write and run a gql± query with a regexp function at the root, but when I print it with AsString that part is completely omitted, producing an invalid query. I think that writeRoot in github.com/dgraph-io/dgraph/graphql/dgraph/graphquery.go is the culprit. It should probably be extended to support all valid gql± queries.
I parse this query
query{
q0(func: regexp(name, /myname.*/),first:1){
a.name: test.name, a.open: test.open
test.has{
test.Temporal{
b.name: test.name, b.open: test.open, b.xid: test.xid
}
}
}
}
but when I print the AST I get
query {
q0 : , first: 1) a.name : test.name
a.open : test.open
test.has {
test.Temporal {
b.name : test.name
b.open : test.open
b.xid : test.xid
}
}
}
Notice the regexp call is completely missing.