Skip to content
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

Open
wants to merge 64 commits into
base: develop
Choose a base branch
from
Open

Conversation

kharanenka
Copy link
Contributor

No description provided.

$this->bStatus = false;
$this->iErrorCode = $iCode;
if (empty($sMessage)) {
$this->sErrorMessage = Lang::get('message.'.$iCode, $arReplace);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот тут в будущем нужно будет подкоректировать путь к тексту ошибки

|
*/

'route_name' => 'graphql',
Copy link
Contributor Author

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);
Copy link
Contributor Author

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
Copy link
Contributor Author

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(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"url" - у ключей массива должны быть одинарные ковычки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants