FHIR Chat · Capability statement for GraphQL · implementers

Stream: implementers

Topic: Capability statement for GraphQL


view this post on Zulip Venu Gopal (Mar 01 2021 at 07:07):

Its not clear how can a capability statement be assigned to GraphQL servers from the FHIR Spec. For other servers the /metadata is used. Should we query the CapabilityStatement resource instead, from the /$GraphQL endpoint ? Any guidance from other implementers is appreciated

view this post on Zulip Lloyd McKenzie (Mar 01 2021 at 14:32):

The /metadata endpoint exposes that CapabilityStatement that applies to that specific server 'right now'. Accessing that endpoint is not a search and that endpoint must be available on all servers, regardless of whether they support CapabilityStatement or not. The $graphql endpoint allows you to search, so it's only useful at retrieving data that's available for searching. You could use it to retrieve CapabilityStatements if the system happened to expose a CapabilityStatement endpoint (i.e. it served as a registry of CapabilityStatements) and happened to support graphQL.

view this post on Zulip Venu Gopal (Jun 05 2021 at 01:30):

Lloyd McKenzie said:

The /metadata endpoint exposes that CapabilityStatement that applies to that specific server 'right now'. Accessing that endpoint is not a search and that endpoint must be available on all servers, regardless of whether they support CapabilityStatement or not. The $graphql endpoint allows you to search, so it's only useful at retrieving data that's available for searching. You could use it to retrieve CapabilityStatements if the system happened to expose a CapabilityStatement endpoint (i.e. it served as a registry of CapabilityStatements) and happened to support graphQL.

Thank you @Lloyd McKenzie missed your response. your clarification helps. I missed your response. I would like to state $graphql also supports CUD via mutations. Is that not be done as per the FHIR standard ?

view this post on Zulip Lloyd McKenzie (Jun 05 2021 at 02:26):

CUD?

view this post on Zulip Venu Gopal (Jun 05 2021 at 03:04):

Create, Update, Delete :-)

view this post on Zulip Lloyd McKenzie (Jun 05 2021 at 03:06):

Ah, was missing the 'R' I'm used to. There's no specific ability in CapabilityStatement to talk about GraphQL feature support. Presumably we could come up with a 'feature' way to do it using the CapabilityStatement2 approach, and that would probably be the preferred approach as we don't want to make CapabilityStatement more complex than it already is.

view this post on Zulip Venu Gopal (Jun 05 2021 at 03:08):

Yeah, sorry my bad. Thank you for your response

view this post on Zulip Josh Mandel (Jun 05 2021 at 23:54):

I think there are two parts you might want here:

  1. Use the standard mechanism for advertising support for operations to indicate that you support https://www.hl7.org/fhir/resource-operation-graphql.html -- i.e., your GET /metadata response would include an entry for the $graphql operation in CapabilityStatement.rest.operation (and possibly also at the resource level)

  2. At your graphql endpoint, support graphql introspection queries to let clients discover which queries and mutations are supported, as well as rest of your schema details, per https://graphql.org/learn/introspection/

view this post on Zulip Venu Gopal (Jun 06 2021 at 01:10):

Thank you @Josh Mandel I am going to do the first, will check the second as well


Last updated: Apr 12 2022 at 19:14 UTC