-
Notifications
You must be signed in to change notification settings - Fork 275
[MCP] Added description property to entities and GraphQL Schema. #2861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for entity descriptions in Data API Builder's GraphQL schema generation. The feature allows developers to include descriptive comments in their configuration that will be surfaced as documentation in the generated GraphQL schema.
- Adds a
description
property to the Entity model for storing entity-level documentation - Updates GraphQL schema generators to include entity descriptions as GraphQL comments and HotChocolate type descriptions
- Adds JSON schema validation and unit tests for the new description functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/Config/ObjectModel/Entity.cs | Adds optional Description property to Entity record |
src/Core/Generator/SchemaGenerator.cs | Updates Cosmos DB schema generator to include entity descriptions as GraphQL comments |
src/Service.GraphQLBuilder/Sql/SchemaConverter.cs | Updates SQL schema converter to include entity descriptions in GraphQL type definitions |
schemas/dab.draft.schema.json | Adds JSON schema definition for the new description property |
src/Service.Tests/SqlTests/GraphQLQueryTests/MsSqlGraphQLQueryTests.cs | Adds unit test to verify entity descriptions appear in generated GraphQL schema |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@microsoft-github-policy-service agree company="Microsoft" |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
3fb3cc5
to
e33142f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, might want to add a test case for edge case like empty string, make sure it behaves as desired.
src/Service.Tests/SqlTests/GraphQLQueryTests/MsSqlGraphQLQueryTests.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
description
(metadata) #2834]What is this change?
description
property to the entity model and ensures it is deserialized from the config.How was this tested?
Sample Request(s)
GraphQL Introspection Query:
Sample Query Response:
Sample SDL output: