Sha256: b5e11af13d4314e653c9e9c8f1790d1e79b8cca7e09a058374be4da77f662677

Contents?: true

Size: 577 Bytes

Versions: 57

Compression:

Stored size: 577 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

57 entries across 57 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.35.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.34.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.33.1 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.33.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.32.1 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.32.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.31.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.30.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.29.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.28.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.27.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.26.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.25.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.24.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.23.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.22.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.21.0 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.20.1 lib/project_types/extension/tasks/get_app.rb
shopify-cli-2.20.0 lib/project_types/extension/tasks/get_app.rb