Hi Adrian,
the GraphQL servlet itself doesn't have a way to invoke saved queries
instead. So you could potentially develop your own way of
managing/storing/sharing your queries either in EDG itself (e.g. in some
Data Graph) or store them outside in your client applications.
If you want to "hide" the details of GraphQL queries, you could turn
them into ADS JavaScript and wrap those scripts into web services. ADS
includes a function graph.ql() that can be used to invoke a GraphQL
query including parameter passing:
graph.ql(`{ cities { uri } }`)
To define web services in ADS, see
https://www.topquadrant.com/doc/7.2/ext/points.html#ext-services-ads
Such web services could, of course, also query the available GraphQL
queries from a graph, including the TCH graphs where the current
instances of
<http://teamwork.topbraidlive.org/graphql.search#rawGQLQuery> are stored
when you press the save query button.
Maybe this gives you some ideas?
Holger
On 2022-06-08 2:25 am, AdrianP wrote:
We're working to more formally adopt GraphQL as a way to consume data
from EDG for various integration reasons.
I see a way in the GraphiQL UI to save a named query but is there a
way to call saved queries by name? And pass in parameters?
When I look 'under the hood' (using the browser's dev tools) at the
request that is being made when I execute a saved query it is just
running the query itself. This has disadvantages, like having to
spread the query across multiple consuming clients such that if
something changes the updates need to happen in multiple places.
Making a single change to the saved query that is being called by name
by the consuming clients is preferred (assuming the contract isn't
changing in a breaking way).
This is a similar paradigm to a stored proc in the relational database
world.
An added nice feature would be the ability to automate deployments of
saved queries. Is that possible?
thx...
Adrian Pfisterer.
--
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/25e48173-21fd-485a-b4cb-0dfa7b9c3a8en%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/25e48173-21fd-485a-b4cb-0dfa7b9c3a8en%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups "TopBraid
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/fd102648-8223-dc6b-7b09-40526e35aca3%40topquadrant.com.