Azure / Azure/data-api-builder

Cosmos: Add config validations to ensure GraphQL types are either entity names or singular types

Offen
#893 0 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @sourabh1007 Auf GitHub ansehen
cosmos usability validation
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 17 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Today, both the runtime configuration and the GraphQL schema are provided by the customer. For the engine, to behave correctly, the types specified in the GraphQL schema here:
https://github.com/Azure/data-api-builder/blob/d5820d402fb746377a87b13298ca0e6ad4cb03d3/src/Service/schema.gql#L9

should match either
1) the entity name in the runtime configuration see this: https://github.com/Azure/data-api-builder/blob/d5820d402fb746377a87b13298ca0e6ad4cb03d3/src/Service/dab-config.Cosmos.json#L34
or
2) the `graphql.type.singular` property of the entity: https://github.com/Azure/data-api-builder/blob/d5820d402fb746377a87b13298ca0e6ad4cb03d3/src/Service/dab-config.Cosmos.json#L39

It is quite possible to have configuration errors, where the schema doesn't match the configuration. This issue is to add validations at startup to make sure these errors are easily found and a useful error is given to the developer to correct their configuration as per the graphql schema.
E.g. of someone who already encounter this: https://github.com/Azure/data-api-builder/issues/876

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.