Skip to content

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

Closed
DayS1eeper wants to merge 1 commit into
graphql-python:masterfrom
DayS1eeper:incorrect-subscription-execution-result-using-data-loader-fix
Closed

DayS1eeper wants to merge 1 commit into
graphql-python:masterfrom
DayS1eeper:incorrect-subscription-execution-result-using-data-loader-fix

Conversation

@DayS1eeper

@DayS1eeper DayS1eeper commented Oct 7, 2021 •

Copy link
Copy Markdown

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
Copy Markdown
Author

@syrusakbary Could you please take a look at this?

@TitanFighter

Copy link
Copy Markdown

@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

DayS1eeper commented Oct 8, 2021 •

Copy link
Copy Markdown
Author

@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.

2 participants