Search Modifiers in GraphQL
# support
k
Hey @reshma @rahul1 , is there a way to recrete this REST query to the graphql equivalent? {REST API}/Basic?code=icd-code&identifier:contains=bloo? I want to find all Basic resources where the code = icd-code and who has an identifier where the value key contains 'bloo'. In REST it seems to do "contains" correctly, but in GraphQL it doesn't seem to work.
For anyone with the same question in the future, I THINK I figured out the answer. Not sure if this is the recommended answer since it different from the REST keys, but it seems to work.
Copy code
#QUERY
query basicResource($code: String, $filter: String) {
    BasicList(code: $code, _filter: $filter) {
        id
        text {
            status
            div
        }
         ...
    }
}

#VARIABLES
{
    "code": "icd-code",
    "filter": "identifier co bloo"
}
This should filter for all
Basic
resources where
code=icd-code
and
identifier contains 'bloo'
r
Hi @khonlieu As we note in these docs (https://www.medplum.com/docs/graphql/basic-queries), search modifiers such as
:contains
are not avaialable in the graphQL API
You're use of the _filter parameter is correct here
You can check out this blog post on GraphQL vs. Rest https://www.medplum.com/blog/graphql-vs-rest#graphql
180 Views