graphql-core-legacy icon indicating copy to clipboard operation
graphql-core-legacy copied to clipboard

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

Open DayS1eeper opened this issue 3 years ago • 3 comments

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 avatar Oct 07 '21 07:10 DayS1eeper

@syrusakbary Could you please take a look at this?

DayS1eeper avatar Oct 07 '21 08:10 DayS1eeper

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

TitanFighter avatar Oct 07 '21 22:10 TitanFighter

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

DayS1eeper avatar Oct 08 '21 04:10 DayS1eeper