Sha256: f9271c386b0a1f5bc2ae64a3dfcd881bd4630576018ecfed7a1ff5a6807e439f
Contents?: true
Size: 575 Bytes
Versions: 6
Compression:
Stored size: 575 Bytes
Contents
# frozen_string_literal: true require 'shopify_cli' module Extension module Tasks class GetApp < ShopifyCli::Task GRAPHQL_FILE = 'get_app_by_api_key' RESPONSE_FIELD = %w(data) APP_FIELD = 'app' def call(context:, api_key:) input = { api_key: api_key } response = ShopifyCli::PartnersAPI.query(context, GRAPHQL_FILE, input).dig(*RESPONSE_FIELD) context.abort(context.message('tasks.errors.parse_error')) if response.nil? Converters::AppConverter.from_hash(response.dig(APP_FIELD)) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems