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

FIX: subscription returns incorrect result when data loader is used during fields resolving. #287

Closed
wants to merge 1 commit into from
Closed

FIX: subscription returns incorrect result when data loader is used during fields resolving. #287

wants to merge 1 commit into from

Conversation

DayS1eeper
Copy link

@DayS1eeper DayS1eeper commented Oct 7, 2021

This PR fixes batching for subscriptions.

Without this fix batch_load_fn is called after every load call and test_batches_subscription_result fails on

assert subscription_results[0].data == expected_data_1 

because subscription_results[0].data contains

{'newPosts': <Promise at 0x7f9ea611c6a0 fulfilled with [OrderedDict([('id', 1), ('tag', OrderedDict([('id', 1), ('name', '#music')]))]), OrderedDict([('id', 2), ('tag', OrderedDict([('id', 2), ('name', '#beautiful')]))]), OrderedDict([('id', 3), ('tag', OrderedDict([('id', 1), ('name', '#music')]))])]>} 

@DayS1eeper
Copy link
Author

@syrusakbary Could you please take a look at this?

@TitanFighter
Copy link

@DayS1eeper this is legacy repo, with the last commit more than 1 year ago. Probably you need https://github.com/graphql-python/graphql-core

@DayS1eeper
Copy link
Author

DayS1eeper commented Oct 8, 2021

@TitanFighter I use graphql-core 2.3.2 and graphene 2.1.9 in my project.

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

2 participants