Replies: 3 comments 1 reply
-
The same problem is actually there for woql queries that may take documents as input. These too would be nice if they were typed, but they don't have to be typed in the way we type classes. So a more generic way of looking at this is that we may want typed data transfer objects for use in wqol queries. Those types can either be part of the schema, or we could submit them along with the woql query. |
Beta Was this translation helpful? Give feedback.
-
For stored queries, being able to express inputs and outputs in terms of typed data transfer objects would be nice too. |
Beta Was this translation helpful? Give feedback.
-
This would indeed be great, but where does the WOQL query get stored and how do we refer to the type designation of the element referred to? This is something I haven't thought a satisfactory answer for. Should we be storing queries in the schema directly? The current templating mechanism breaks all guarantees about form and structure but decouples results from the schema which is convenient if you don't store the woql using the same schema. |
Beta Was this translation helpful? Give feedback.
-
Currently we have the ability from WOQL to return structured json output through a generic templating mechanism. While this is great, there's a disadvantage with the current design: our json output is not schema-validated.
While this is probably fine for many sorts of use cases, it would be nice if we could guarantee that the output of a woql query follows a particular structure. This would allow clients to ingest this data using auto-generated class definitions. It could also allow us to insert the result of a woql query straight into the database, or otherwise integrate it into pipelines that expect some sort of data.
We could possibly use the ordinary schema we already have for this, but data transfer objects are not necessarily the same as storage objects. for one, they don't necessarily need IDs everywhere. So we may want to expand the schema language a bit with this.
Beta Was this translation helpful? Give feedback.
All reactions