Azure / Azure/data-api-builder

[Enhancement]: new config item to disable plural / SELECT queries against Cosmos DB (allow ReadItemAsync only)

Abierto
#2,433 0 comentarios 0 reacciones 1 asignado Reclamado por @sajeetharan Ver en GitHub
cosmos enhancement known-issue
Lenguaje dominante
C#
Estrellas
1.5k
Forks
370
Merge medio
3 d 22 h
PR fusionados (30 d)
9

Descripción

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"
}
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.