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

Allow using a custom resolver function on DjangoConnectionField #1513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mb1511
Copy link

@mb1511 mb1511 commented Apr 2, 2024

We ran into an issue the other day trying to add a custom resolver function to a DjangoConnectionField:

class Query(ObjectType)
    some_field = DjangoConnectionField(SomeType, resolver=some_resolver)

In this case the some_resolver function is simply ignored.

We managed to work around it by defining the resolver on the query using the default def resolve_{field}: pattern and just linked that to return the result of the function we wanted to use.

Admittedly, its a pretty niche use case, but still thought it would be nice to try and fix.

@mb1511 mb1511 force-pushed the fix-connection-field-custom-resolver branch from a1cc52c to 5436a28 Compare April 16, 2024 12:17
@mb1511 mb1511 force-pushed the fix-connection-field-custom-resolver branch from 5436a28 to 9e6fc7f Compare April 18, 2024 09:55
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

Successfully merging this pull request may close these issues.

None yet

1 participant