Dynamically Build TigerGraph Queries Using Schema

Hi all,

I’m wondering if anyone else has explored this.

Basically I am wondering if there is a way to accurately build TigerGraph queries programatically.

What I mean is say I have a graph schema, (the vertex types and edges are therefor known),

and say I am given some configuration yaml where there are keys and values

that are basically vertex types to be queried along with supplied field names.

Since a schema exists (meaning data relations are known), is there a way I can leverage that

in order to build a query based off of the provided configuration yaml mentioned?

What I’m eluding to is code gen and some build process that would take care of installing the query,

but if there is something someone else has made or some framework that exists, I’d love to know about it.

Hi Brett,

You could use tiger graph interpret query mode.

https://docs.tigergraph.com/dev/gsql-ref/querying/query-operations#interpret-query

I understand this is probably not applicable to TigerGraph since the queries need to be installed, and that kind of thing.

But what I did do was some scripting that pulls down the graph schema, checks the vertex types, input search fields, etc,

code gens gsql and then installs the query, all based on GitOps, which then the application just constructs the URL from

the config to hit the installed query endpoint.

I will close this for now since I think that only individual scripting can do this.

Hi Brett,

I would like to know more about your solution, sounds very interesting. I would appreciate if you dropped me an email ([szilar...@tigergraph.com](javascript:)) with some details.

Thanks,

Szilard