Skip to content

Added support for Flow publishers coming back from the subscription field data fetcher #3910

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

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

Conversation

bbakerman
Copy link
Member

This allows an implementation to return a Flow.Publisher in their data fetcher

It will be converted to a reactive streams publisher when it comes back out of the ExecutionResult.

Copy link
Contributor

Test Results

  313 files  ±0    313 suites  ±0   55s ⏱️ -1s
3 592 tests +4  3 587 ✅ +4  5 💤 ±0  0 ❌ ±0 
3 681 runs  +4  3 676 ✅ +4  5 💤 ±0  0 ❌ ±0 

Results for commit 93a66bb. ± Comparison against base commit 1318a24.

This pull request removes 192 and adds 174 tests. Note that renamed tests count towards both.
	?
                __schema { types { fields { args { type { name fields { name }}}}}}
                __schema { types { fields { type { name fields { name }}}}}
                __schema { types { inputFields { type { inputFields { name }}}}}
                __schema { types { interfaces { fields { type { interfaces { name } } } } } }
                __schema { types { name} }
                __type(name : "t") { name }
                a1: __schema { types { name} }
                a1: __type(name : "t") { name }
                a2 :  __type(name : "t1") { name }
…
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure23@3f4b840d delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure24@68c87fc3 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure25@bc0f53b delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure20@33f98231 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure21@48284d0e delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure22@557286ad delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure3@2ff95fc6 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure4@ea9e141 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure5@236134a1 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of error args with non null does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_6prov0_closure6@c6e0f32 delegate=graphql.AssertTest@54aca26f owner=graphql.AssertTest@54aca26f thisObject=graphql.AssertTest@54aca26f resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
…

}
Function<Object, CompletionStage<ExecutionResult>> mapperFunction = eventPayload -> executeSubscriptionEvent(executionContext, parameters, eventPayload);
boolean keepOrdered = keepOrdered(executionContext.getGraphQLContext());
SubscriptionPublisher mapSourceToResponse = new SubscriptionPublisher(publisher, mapperFunction, keepOrdered);
ExecutionResultImpl executionResult = new ExecutionResultImpl(mapSourceToResponse, executionContext.getErrors());
return executionResult;
return new ExecutionResultImpl(mapSourceToResponse, executionContext.getErrors());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just redundant variables cleanup

}
};
}

}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this code into CommonMessagePublisher for re-use reasons

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