createCustomerAddress = $createCustomerAddress; $this->extractCustomerAddressData = $extractCustomerAddressData; } /** * @inheritdoc */ public function resolve( Field $field, $context, ResolveInfo $info, array $value = null, array $args = null ) { /** @var ContextInterface $context */ if (false === $context->getExtensionAttributes()->getIsCustomer()) { throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.')); } if (empty($args['input']) || !is_array($args['input'])) { throw new GraphQlInputException(__('"input" value should be specified')); } $address = $this->createCustomerAddress->execute($context->getUserId(), $args['input']); return $this->extractCustomerAddressData->execute($address); } }