module Eco::API::UseCases::GraphQL::Helpers::Location::Command::Optimizations
def commands_payload_without_structure_block
- Note: - this servces the purpose of optimizing/speeding up the requests.
def commands_payload_without_structure_block proc { clientMutationId error { # rubocop:disable Style/BlockDelimiters message conflictingIds validationErrors { # rubocop:disable Style/BlockDelimiters error message } } results { # rubocop:disable Style/BlockDelimiters command { # rubocop:disable Style/BlockDelimiters id state __typename } ok error { # rubocop:disable Style/BlockDelimiters conflictingIds message validationErrors { # rubocop:disable Style/BlockDelimiters error message } } } } end
def commands_per_page
def commands_per_page if self.class.const_defined?(:COMMANDS_PER_PAGE) self.class::COMMANDS_PER_PAGE else DEFAULT_COMMANDS_PER_PAGE end end
def default_tree_tracking_mode
- :per_batch -> at the end of each batch / stage (on last page)
- :per_request -> on each request
Available options are:
def default_tree_tracking_mode :per_request end
def force_continue?
def force_continue? if self.class.const_defined?(:FORCE_CONTINUE) self.class::FORCE_CONTINUE else DEFAULT_FORCE_CONTINUE end end
def scope_commands_block(idx, total, track_tree_mode: default_tree_tracking_mode)
-
(Proc, NilClass)- the payload block
Other tags:
- Note: -
def scope_commands_block(idx, total, track_tree_mode: default_tree_tracking_mode) case track_tree_mode when :per_request nil when :once commands_payload_without_structure_block when :per_batch return nil if idx == total commands_payload_without_structure_block end end