Skip to content

Commit 8992b26

Browse files
committed
mapping pydantic.Field.alias attr as graphene.Field.name
1 parent 2fd67a8 commit 8992b26

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

graphene_pydantic/converters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def convert_pydantic_field(
125125
)
126126
field_kwargs.setdefault("required", field.required)
127127
field_kwargs.setdefault("default_value", field.default)
128+
field_kwargs.setdefault("name", field.alias)
128129
# TODO: find a better way to get a field's description. Some ideas include:
129130
# - hunt down the description from the field's schema, or the schema
130131
# from the field's base model

0 commit comments

Comments
 (0)