Class: Resolvers::BlobsResolver
- Inherits:
-
BaseResolver
- Object
- GraphQL::Schema::Resolver
- BaseResolver
- Resolvers::BlobsResolver
- Includes:
- ActiveSupport::NumberHelper, Gitlab::Graphql::Authorize::AuthorizeResource, Gitlab::Utils::StrongMemoize, LooksAhead
- Defined in:
- app/graphql/resolvers/blobs_resolver.rb
Constant Summary collapse
- DATA_FIELDS =
i[raw_blob base64_encoded_blob raw_text_blob plain_data].freeze
- TOTAL_BLOB_DATA_SIZE_LIMIT =
20.megabytes
- HUMAN_LIMIT =
ActiveSupport::NumberHelper::NumberToHumanSizeConverter.convert(TOTAL_BLOB_DATA_SIZE_LIMIT, {})
- SIZE_LIMIT_EXCEEDED_ERROR =
"Max blobs size limit exceeded (%{total} / #{HUMAN_LIMIT}).".freeze
Constants included from Gitlab::Graphql::Authorize::AuthorizeResource
Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR
Class Method Summary collapse
-
.resolver_complexity(args, child_complexity:) ⇒ Object
We fetch blobs from Gitaly efficiently but it still scales O(N) with the number of paths being fetched, so apply a scaling limit to that.
Methods included from LooksAhead
Methods included from Gitlab::Graphql::Authorize::AuthorizeResource
#authorize!, #authorized_find!, #authorized_resource?, #find_object, #raise_resource_not_available_error!
Methods inherited from BaseResolver
as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calculate_ext_conn_complexity, calls_gitaly!, calls_gitaly?, complexity, complexity_multiplier, #current_user, last, #object, #offset_pagination, requires_argument!, requires_argument?, #select_result, single, #single?, single_definition_blocks, singular_type, when_single
Methods included from Gitlab::Utils::Override
#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!
Class Method Details
.resolver_complexity(args, child_complexity:) ⇒ Object
We fetch blobs from Gitaly efficiently but it still scales O(N) with the number of paths being fetched, so apply a scaling limit to that.
36 37 38 |
# File 'app/graphql/resolvers/blobs_resolver.rb', line 36 def self.resolver_complexity(args, child_complexity:) super + args.fetch(:paths, []).size end |