Shortest Path and/or UID via GraphQL API?

I know the GraphQL api is still a work in progress, but I am curious if it will have the shortest path functionality that the GraphQL +/- query language has?

In the meantime, is there a way that I can the uid of particular nodes via the GraphQL API so that I can use those uids in the path function? For example if I have a type:

# name is an id to make it globally unique, 
# so there is only 1 name and 1 uid combination. 
# if there is a better way of doing this please let me know.
type Entity {
    name: String @id 
    ...properties
}

The GraphQL API would expose a queryEntity query function, and it seems that Dgraph assigns a node a uid. However, I cannot seem to pull off the uid property from the queryEntity query.

query {
    queryEntity() {
         name
         uid # <-- causes an error as it is not a property on type Entity.
    }
}

I can use the GraphQL +/- queries to get the uid’s then pipe those into the shortest path function, but I am curious if that internal node uid will be exposed via GraphQL? or Maybe I am setting up the types inccorectly? Thank you!

shortest-path is not yet supported, as are many of the features that exist only in gql + -. Most of these features are being planned for after April, to start working on them.

I’m not sure only @michaelcompton or @pawan can say. But I think that if you had in that Type the predicate “uid” it should work theoretically.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.