Is there a package/methodology for dynamically creating a graphql query on the client-side? For example, let's pretend that I have the following query
query {
foo {
a
b
c {
d {
e
f
}
g
}
}
I want to allow the user to pick/choose what data fields get returned from that query. In other words, if they do not want a field back, I would omit it from the query. * This is because some fields contain a very large amount of data and it would be better to avoid bandwidth issues if it can be avoided.
Do I have to build the query by hand (ugh) or is there a javascript tool out there that people use for this situation?
I saw this but it looks like it's no longer maintained and has some issues noted in the issues tab: https://github.com/codemeasandwich/graphql-query-builder