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

Create resolve_to utility #21

Closed
rafalp opened this issue Aug 22, 2018 · 0 comments
Closed

Create resolve_to utility #21

rafalp opened this issue Aug 22, 2018 · 0 comments
Assignees
Labels
help wanted Extra attention is needed roadmap Feature that we want to have included
Milestone

Comments

@rafalp
Copy link
Contributor

rafalp commented Aug 22, 2018

Python variables are usually named using the snake_case, whereas majority of JS written today uses the camelCase. Ariadne will need to provide a way to resolve one to another.

The idea is to create resolver_for function taking single name argument and returning resolver for specified attr/key name, enabling explicit mapping as such:

resolvers_map = {
    "User": {
        "lastVisitedOn": resolve_to("last_visited_on")
    }
}

Other advantage of having such utility would be arbitrary field names:

resolvers_map = {
    "User": {
        "lastVisitedOn": resolve_to("last_visit")
    }
}
@rafalp rafalp added the roadmap Feature that we want to have included label Aug 22, 2018
@rafalp rafalp added this to the 0.1 milestone Aug 22, 2018
@rafalp rafalp added the help wanted Extra attention is needed label Aug 23, 2018
@salwator salwator self-assigned this Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed roadmap Feature that we want to have included
Projects
None yet
Development

No branches or pull requests

2 participants