-
-
Couldn't load subscription status.
- Fork 595
Resolve TODO: Replace EnumDefinition with StrawberryEnum #3999
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
a6224f4
3d08e36
ccfc3fb
4b46d69
ec4a439
04a042c
5b7b16a
9de176a
0e5bd53
c51a46c
39b863a
00372fa
79622de
ad2b825
5fd2888
f21bcca
fc97abe
e50d386
7dd1461
f8bd6b3
81e3121
66fafe6
21ae6d5
0433b9d
aec0b97
9d5dbb4
9bad777
23bd876
60d69f6
7bfe977
4ddfc9d
a5b713d
ad8cc5b
d9a91ad
ac2fbdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Release type: patch | ||
|
|
||
| Resolve TODO's about EnumDefinition by renaming it to StrawberryEnum | ||
sourcery-ai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ class EnumValue: | |
|
|
||
|
|
||
| @dataclasses.dataclass | ||
| class EnumDefinition(StrawberryType): | ||
| class StrawberryEnum(StrawberryType): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like my comment below, we also need to expose the deprecated version of this Like in https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/types/base.py#L456-L456 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, updating now! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated, @bellini666 , I use the same implementation we done in this PR #2836 . |
||
| wrapped_cls: EnumMeta | ||
| name: str | ||
| values: list[EnumValue] | ||
|
|
@@ -151,7 +151,7 @@ def _process_enum( | |
| ) | ||
| values.append(value) | ||
|
|
||
| cls._enum_definition = EnumDefinition( # type: ignore | ||
| cls._enum_definition = StrawberryEnum( # type: ignore | ||
| wrapped_cls=cls, | ||
| name=name, | ||
| values=values, | ||
|
|
@@ -238,4 +238,4 @@ def wrap(cls: EnumType) -> EnumType: | |
| return wrap(cls) | ||
|
|
||
|
|
||
| __all__ = ["EnumDefinition", "EnumValue", "EnumValueDefinition", "enum", "enum_value"] | ||
| __all__ = ["EnumValue", "EnumValueDefinition", "StrawberryEnum", "enum", "enum_value"] | ||
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.
Would this be a minor? It does more than just fixing, it also changes variable names
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.
I agree 100% with you, also will add a deprecated info on the release