Conversation
…, fields, params and input fields Threads an optional description= kwarg through the graph-side schema builders (ObjectType, InterfaceType, InputObjectType, field, param, input_field) and propagates it into the generated GraphQLObjectType / GraphQLInterfaceType / GraphQLInputObjectType / GraphQLField / GraphQLArgument / GraphQLInputField, so descriptions show up in introspection and GraphiQL. Bump version to 0.5.0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The updated GraphQL schema generation still omits default_value for arguments/input fields, dropping defaults from the generated schema despite existing has_default handling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds first-class description= support across GraphLayer schema definitions and ensures those descriptions propagate into the generated graphql-core schema objects so they appear in introspection/GraphiQL.
Changes:
- Adds optional
descriptionto schema building blocks (ObjectType,InterfaceType,InputObjectType,field,param,input_field). - Propagates descriptions into generated
GraphQL*types/fields/arguments/input-fields. - Adds tests for description propagation and bumps package version to
0.5.0.
| File | Description |
|---|---|
graphlayer/schema.py |
Introduces description fields on schema objects (types/fields/params/input-fields). |
graphlayer/graphql/schema.py |
Passes description into generated graphql-core schema objects. |
tests/graphql/test_schema.py |
Adds coverage asserting description propagation into GraphQL schema objects and updates matchers accordingly. |
setup.py |
Updates package version to 0.5.0. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
88
to
+91
| if graph_field.has_default and isinstance(graphql_type, graphql.GraphQLNonNull): | ||
| graphql_type = graphql_type.of_type | ||
|
|
||
| return graphql.GraphQLInputField(type_=graphql_type) | ||
| return graphql.GraphQLInputField(type_=graphql_type, description=graph_field.description) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
description=kwarg toObjectType,InterfaceType,InputObjectType,field(),param(), andinput_field()GraphQLObjectType/GraphQLInterfaceType/GraphQLInputObjectType/GraphQLField/GraphQLArgument/GraphQLInputFieldincreate_graphql_schema, so they surface in introspection and GraphiQLNeeded by the knowledge-base app, which wants to start documenting its GraphQL schema (starting with the top-level
diseasesquery) but currently has nowhere to attach a description — graphlayer drops it silently today.Test plan
pytest tests/— 276 passed (270 existing + 6 new covering description propagation for object/interface/input-object types, fields, params, and input fields)