-
Notifications
You must be signed in to change notification settings - Fork 818
feat: added object_type_name_prefix #1466
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: master
Are you sure you want to change the base?
Changes from 1 commit
2dee4f2
0633b62
8cb9791
8423706
97dd7e5
b0e179f
673a282
10c53d3
0ea4636
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,3 +48,18 @@ def get_underlying_type(_type): | |
| while hasattr(_type, "of_type"): | ||
| _type = _type.of_type | ||
| return _type | ||
|
|
||
|
|
||
| def get_type_name(graphene_type, type_name_prefix): | ||
| type_name_prefix = ( | ||
| graphene_type._meta.type_name_prefix | ||
| if graphene_type._meta.type_name_prefix is not None | ||
| else type_name_prefix | ||
| ) | ||
| if type_name_prefix: | ||
| return ( | ||
| type_name_prefix[0].upper() | ||
| + type_name_prefix[1:] | ||
| + graphene_type._meta.name | ||
| ) | ||
| return graphene_type._meta.name | ||
|
Comment on lines
+53
to
+65
Member
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. It's great that we can override the prefixes for individual types using Personally I dislike disabling the prefix using One potential alternative could be to use a boolean flag, such as |
||
Uh oh!
There was an error while loading. Please reload this page.