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

GraphQLService execute on production #342

Open
jimhaakman opened this issue Feb 26, 2021 · 2 comments
Open

GraphQLService execute on production #342

jimhaakman opened this issue Feb 26, 2021 · 2 comments

Comments

@jimhaakman
Copy link

I've encountered a problem when deploying CraftQL to production. And devmode is not active.

In markhuot\CraftQL\Services\GraphQLService.php

$debug = Craft::$app->config->getGeneral()->devMode ? DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::RETHROW_INTERNAL_EXCEPTIONS : null;
        return GraphQL::executeQuery($schema, $input, null, null, $variables)->toArray($debug);

This throws an error as GraphQL::executeQuery->toArray expects $debug to be an integer.

Thank you very much.

@AlexJezior
Copy link

I am also experiencing this issue as well. The only way to have my application working is to set the ENVIRONMENT=dev, otherwise it's rendered useless. Here's the stacktrace from my web.log:

2021-02-28 23:34:42 [-][1][-][error][TypeError] TypeError: Argument 1 passed to GraphQL\Executor\ExecutionResult::toArray() must be of the type int, null given, called in /var/www/craftsite.com/vendor/markhuot/craftql/src/Services/GraphQLService.php on line 132 and defined in /var/www/craftsite.com/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php:136
Stack trace:
#0 /var/www/craftsite.com/vendor/markhuot/craftql/src/Services/GraphQLService.php(132): GraphQL\Executor\ExecutionResult->toArray(NULL)
#1 /var/www/craftsite.com/vendor/markhuot/craftql/src/Controllers/ApiController.php(121): markhuot\CraftQL\Services\GraphQLService->execute(Object(GraphQL\Type\Schema), '{\n        globa...', NULL)
#2 [internal function]: markhuot\CraftQL\Controllers\ApiController->actionIndex()
#3 /var/www/craftsite.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /var/www/craftsite.com/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#5 /var/www/craftsite.com/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('index', Array)
#6 /var/www/craftsite.com/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('index', Array)
#7 /var/www/craftsite.com/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('craftql/api/ind...', Array)
#8 /var/www/craftsite.com/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('craftql/api/ind...', Array)
#9 /var/www/craftsite.com/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#10 /var/www/craftsite.com/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /var/www/craftsite.com/web/index.php(22): yii\base\Application->run()
#12 {main}

redboer added a commit to redboer/craftql that referenced this issue Mar 31, 2021
@jimhaakman
Copy link
Author

@markhuot can the fix by @redboer get merged?.

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

No branches or pull requests

2 participants