14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/project_types/extension/tasks/create_extension.rb', line 14
def call(context:, api_key:, type:, title:, config:, extension_context: nil)
input = {
api_key: api_key,
type: type,
title: title,
config: JSON.generate(config),
extension_context: extension_context,
}
response = ShopifyCLI::PartnersAPI.query(context, GRAPHQL_FILE, **input).dig(*RESPONSE_FIELD)
context.abort(context.message("tasks.errors.parse_error")) if response.nil?
abort_if_user_errors(context, response)
Converters::RegistrationConverter.from_hash(context, response.dig(REGISTRATION_FIELD))
end
|