Skip to content
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

set_alias support for nested attributes #1181

Open
dacevedo12 opened this issue May 14, 2024 · 0 comments
Open

set_alias support for nested attributes #1181

dacevedo12 opened this issue May 14, 2024 · 0 comments

Comments

@dacevedo12
Copy link

I have a use case where the parent resolver returns something like this:

Person(name="John", state=PersonState(married=False))

To implement person { married }, you would need to create a new resolver returning parent.state.married, and in a large schema, there are many of these trivial resolvers.

It would be great if set_alias supported nested attributes, so one could do person.set_alias("married", "state.married"), maybe using operator.attrgetter instead of getattr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant