Stream: cql
Topic: comparison of CQL to GraphQL
Georg Fette (Apr 16 2019 at 17:31):
A kind of heretical question in this thread: What is mightier, CQL or GraphQL ?
Grahame Grieve (Apr 16 2019 at 22:46):
the pen is mightier than the sword. Or not, if you're facing a guy brandishing pen or sword
Grahame Grieve (Apr 16 2019 at 22:46):
in the case of graphQL and cql, they are doing radically different things, so it's even less valid to ask that kind of question
Georg Fette (Apr 17 2019 at 07:25):
You are using Bonetti’s Defense against me, ah?
I have not yet dived into GraphQL that much, so perhaps the question is indeed a bit dumb.
It is true that they do things differently but aren't they still comparable like the comparison of FHIR-REST-search and CQL ?
GraphQL and CQL both are capable of searching within resources and returning resource instances. Both can constrain some aspects of the desired objects as well as the form of the returned data. I am unsure about the amount of operators (boolean, arithmetic, string manipulation, etc.) that are available in GraphQL (this discussion in this issue https://github.com/graphql/graphql-js/issues/585 puzzles me a bit).
It seems to me that both query languages had different use cases for which they were developed, so they support different technical concepts and have different syntactical sugar. But I wonder if they could not be replaced by each other, at least for some use cases.
When I would like to get some fields of a patient with a given id I am free to use a CQL statement, a FHIR-REST-search or a GraphQL query. For more complicated use cases it could be that I have to use a combination of CQL and GraphQL to receive desired result.
For which use cases is GraphQL intended to be used, or for which is it already in use ?
Bryn Rhodes (Apr 18 2019 at 21:23):
I can't really speak to the GraphQL use cases as I've not spent much time with that spec (it's on my list, I just never seem to get to it). But I can speak to the CQL use cases, authoring clinical logic in a language that tries as much as possible to be independent of where and how that logic will run.
Grahame Grieve (Apr 18 2019 at 21:26):
You are using Bonetti’s Defense against me, ah?
Robert McClure (Apr 25 2019 at 14:23):
Ok, you made me go here
Last updated: Apr 12 2022 at 19:14 UTC