We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dc2fdf commit 492a15fCopy full SHA for 492a15f
graphene_pydantic/types.py
@@ -32,7 +32,16 @@ def construct_fields(
32
the future we hope to implement field-level overrides that we'll have to merge in.
33
"""
34
fields = {}
35
- for name, field in model.__fields__.items():
+ if only_fields:
36
+ fields_to_convert = (
37
+ (k, v) for k, v in model.__fields__.items() if k in only_fields
38
+ )
39
+ elif exclude_fields:
40
41
+ (k, v) for k, v in model.__fields__.items() if k not in only_fields
42
43
+
44
+ for name, field in fields_to_convert:
45
converted = convert_pydantic_field(field, registry)
46
registry.register_orm_field(obj_type, name, field)
47
fields[name] = converted
0 commit comments