GraphQL, read and use graph label in label directive as opposed to just static values?


#1

Any plans on adding the ability to read the current nodes graph label and scope to that label in the label directive, for example the graphQl docs show the following:

{
  nodes{
    id
    follows @label(v: <fb>) {
      id, name
      follows @label {
        id, name
      }
    }
  }
}

So here is a static graph label, any thoughts on enabling the label to be dynamically specified, or more specifically to use the label of the current node to define the filter, for example in gizmo one can write:

g.Vertex("<id:widget>").In("<assembledIn>").ForEach(function(factory)
{
  var label = factory.Labels().toArray()[0];
 factory.LabelContext(label).In("location").All();
}

Not sure how in graphQL that would surface, as some sort of macro within the @label directive, something like below, or maybe thats pushing the bounds of what the graphQl interface is meant for?

{
  nodes{
    id
    follows @label(v: @currentLabels[0]) {
      id, name
      follows @label {
        id, name
      }
    }
  }
}

#2

This sounds like a good idea, although I’m not sure how it would look like in GraphQL. Maybe someone has more experience with a real GraphQL to propose a solution?