Replies: 4 comments 5 replies
-
Tagging #1274 here fore reference |
Beta Was this translation helpful? Give feedback.
-
Also wanted to mention that there is a https://github.com/supabase/pg_graphql extension that provides a graphql api for postgres. I took a look at how they handle cursors because I figured Medplum could use a similar approach. They create cursors by base64 encoding the list of all of the values used in the {
ConditionConnection (clinical_status: active, patient: example, _sort: "-code") {
count offset pagesize
edges {
mode, score, resource { id, active }
}
first previous next last
}
} The cursor for each returned result would be of the form This cursor provides enough information to recreate the query and filter out all values either before or after any specific There is still some work to actually implement the mapping from |
Beta Was this translation helpful? Give feedback.
-
Hi @msdrigg thanks for the suggestion. A rough implementation of this should fit pretty nicely into the existing GraphQL implementation with 3 steps:
We do not have any values for Regarding cursors... We have looked at using Postgres cursor techniques, but thus far have been ok with using simple |
Beta Was this translation helpful? Give feedback.
-
Implemented in #1934 Released in 2.0.18: https://github.com/medplum/medplum/releases/tag/v2.0.18 |
Beta Was this translation helpful? Give feedback.
-
FHIR GraphQL Connection API
The connection api for graphql is outlined here: https://hl7.org/fhir/graphql.html#searching
It is an alternative api to query lists of resources that provides some additional metadata about the resource list.
Specifically, it allows querying for
ResourceConnection
s of the formThe equivalent query with the
ResourceList
api would look like thisSimple queries are more difficult to express with the
Connection
api, but it offers metadata about the query that could not be expressed in theList
api.My specific use case is wanting to know how many items are in the list without having to query for every item (there may be very many items). I don't see a way to do this with the existing api.
Challenges with implementing this new feature
next x items matching these filters after this item
Alternatives Considered
Beta Was this translation helpful? Give feedback.
All reactions