-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Includes variable-definitions in parsed query #422
Comments
Could you elaborate on what you are using the variables for? Yes, we could expose how Lacinia internally tracks variables and values, but I prefer to do so carefully, in a way that allows us to change things in the future without breaking backwards compatibility. So if I had some insight into what questions you are trying to answer, that might yield a better, more stable solution. |
I'm working on a relational database to GraphQL API generator. For poll-based subscription optimization, the compiler has to group similar GraphQL queries into a single big SQL query to execute against the database. This requires knowing which variables are used (for the grouping), and which types they are (for appropriate SQL casts). Below is a sample:
is currently grouped into this Postgres query:
I got to this with some hacks (i.e: using For the full solution, in the
|
Thanks for the update; been busy here. I'll try to digest what you have posted above. |
Hello,
First of all, thank you for your outstanding work on this library. Using Clojure to build GraphQL backends is a joy and lacinia enables that.
I'm currently in need of doing some dynamic analysis on lacinia queries and could not find a way to look up the consumed variables and their types. Digging into the code, it looks to me that used variables are calculated here to pass downstream, but do not make it into the returned map, therefore are not included in lacinia context.
Is it a good idea to have this value included in the context? If so I can submit a patch sometime next week. Or if there's anything I'm not aware of, please let me know.
Thank you again!
The text was updated successfully, but these errors were encountered: