Capabilities
The capabilities endpoint should return data describing which features the data connector can implement, along with the version of this specification that the data connector claims to implement.
The reference implementation returns a static CapabilitiesResponse
:
async fn get_capabilities() -> Json<models::CapabilitiesResponse> {
Json(models::CapabilitiesResponse {
version: models::VERSION.into(),
capabilities: models::Capabilities {
query: models::QueryCapabilities {
aggregates: Some(models::LeafCapability {}),
variables: Some(models::LeafCapability {}),
explain: None,
nested_fields: models::NestedFieldCapabilities {
filter_by: Some(models::LeafCapability {}),
order_by: Some(models::LeafCapability {}),
aggregates: Some(models::LeafCapability {}),
},
exists: models::ExistsCapabilities {
nested_collections: Some(models::LeafCapability {}),
},
},
mutation: models::MutationCapabilities {
transactional: None,
explain: None,
},
relationships: Some(models::RelationshipCapabilities {
order_by_aggregate: Some(models::LeafCapability {}),
relation_comparisons: Some(models::LeafCapability {}),
}),
},
})
}
Note: the reference implementation supports all capabilities with the exception of query.explain
and mutation.explain
. This is because all queries are run in memory by naively interpreting the query request - there is no better description of the query plan than the raw query request itself!