Passing a set of vertex as input parameter to a query

I wrote a query to report all the edges of a set of input vertices:

CREATE QUERY get_edges(SET<VERTEX> inVertices) FOR GRAPH MyGraph { 
  start = {inVertices};
  ListAccum<edge> @@edgeList;
  tmp = SELECT other FROM start - (:e) - :other
        ACCUM @@edgeList += e;
  print @@edgeList;
}

This works for inputs up to 10 input vertices. If I add any more, I get an error back like below:

The input parameter inVertices.type = ‘’ is not a valid vertex type in graph ‘MyGraph’

Am I doing something wrong or is this a limitation of gsql query parameters?

1 Like

Hi Rupen,

There’s no hard limit on the number of vertices (or other elements) that you can put in a set.

The error message looks to me like TigerGraph can’t find one of your input Vertices in the graph. Can you use the Explore Graph tab (or another method) to verify that each of your inputs exists in the graph?

No, I have verified that the 11th Id I am using actually exists. In fact If I replace the 10th entry with the 11th, it works. But with both 10th and 11th entry, it fails.