<s> from ... error import GraphQLError <EOL> from ... pyutils . defer import Deferred <EOL> class SynchronousExecutionMiddleware ( object ) : <EOL> @ staticmethod <EOL> def run_resolve_fn ( resolver , original_resolver ) : <EOL> result = resolver ( ) <EOL> if isinstance ( result , Deferred ) : <EOL> raise GraphQLError ( '<STR_LIT>' ) <EOL> return result <EOL> @ staticmethod <EOL> def execution_result ( executor ) : <EOL> result = executor ( ) <EOL> return result . result </s>
