How to use @kind graph query? #7437
-
I use @kind graph query and got such error: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The query as you have written requires Documentation on the usage of codeql/ruby/ql/test/library-tests/regexp/parse.ql Lines 8 to 27 in 15caaa7 |
Beta Was this translation helpful? Give feedback.
The query as you have written requires
@kind path-problem
and not@kind graph
.Documentation on the usage of
@kind graph
is hard to find, but it seems to work like this:You have
@kind graph
as metadata and twoquery predicate
s. (You don't define anyfrom
,where
, orselect
clause)The first predicate defines the nodes of the graph and the second defines the edges.
The prototype of
nodes
isquery predicate nodes(ANY_TYPE node, string attr, string val)
and the prototype ofedges
isquery predicate edges(ANY_TYPE pred, ANY_TYPE succ, string attr, string val)
See here for some kind of example:
codeql/ruby/ql/test/library-tests/regexp/parse.ql
Lines 8 to 27 in 15caaa7