-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added abstract classes for graphql API #112
base: develop
Are you sure you want to change the base?
Conversation
$this->bStatus = false; | ||
$this->iErrorCode = $iCode; | ||
if (empty($sMessage)) { | ||
$this->sErrorMessage = Lang::get('message.'.$iCode, $arReplace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот тут в будущем нужно будет подкоректировать путь к тексту ошибки
The field list extension is implemented using the addFields() method instead of events
config/config.php
Outdated
| | ||
*/ | ||
|
||
'route_name' => 'graphql', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если мы даем здесь возможность конфигурации, то может быть сразу добавить здесь ENV переменную, с дефолтным значением 'graphql'?
$iCode = self::CODE_UNKNOWN_ERROR; | ||
} | ||
|
||
$sMessage = Lang::get('message.'.$iCode, $arMessageData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь по коду ошибки получаем сообщение об ошибке. Скорее всего нужно подправить путь в lang файле и добавить в lang файл текста ошибок
* @param $sFieldName | ||
* @return array[] | ||
*/ | ||
protected function getAttachOneFileFields($sFieldName): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь я скорее всего не очень хорошо пояснил свою мысль. Лучше иметь в результате фиксированный массив.
Например:
'preview_image' => [
'url' => '...',
'title' => '...',
'description' => '...',
'file_name' => '...',
],
чтобы потом в js всегда использовать одни и те же конструкции
|
||
foreach ($obFileList as $obFile) { | ||
$arFileData = [ | ||
"url" => $obFile->getPath(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"url" - у ключей массива должны быть одинарные ковычки
No description provided.