Azure / Azure/data-api-builder
[Enhancement]: new config item to disable plural / SELECT queries against Cosmos DB (allow ReadItemAsync only)
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
Our use case for Cosmos DB is point reads by id and partition key. We have many containers for different data and many versions of each dataset keyed using partitions. We want to democratise our fancy new graphql endpoint (thanks DAB team!).
However I fret about excessive RU consumption and "rogue" client apps using queries to retrieve what could be returned by `ReadItemAsync`.
My idea is that with a suitable configuration option e.g. `disableNoSQL : true`, we would make `item_by_pk` the only available entity, and the plural `items` would not be publicised in the schema, and any attempt to surreptitiously query `items` would result in a suitable error.
My initial though above was a data source global config item, but it could make more sense, or have less impact on the implementation if it were at the entity level with a magic value of `disabled`. Maybe not the best idea, but you get the gist.
```json
"graphql": {
"enabled": true,
"type": {
"singular": "item",
"plural": "disabled"
}
```
Contributor guide
Assessment
This issue has not been assessed yet.