magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.49k stars 9.29k forks source link

Graphql not working on fresh installation 2.4.7-p2 #39213

Open felek000 opened 1 day ago

felek000 commented 1 day ago

Preconditions and environment

Steps to reproduce

I used warden to install localy m2. All pages loaded fine. Admin works Swagger page worx.

When i enter https://app.demo.test/graphql

I have error:

{
"errors": [
{
"message": "Syntax Error: Unexpected <EOF>",
"locations": [
{
"line": 1,
"column": 1
}
],
"extensions": {
"file": "[/var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php](https://app.demo.test/var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php)",
"line": 433
}
}
]
}

in magento 2 exeption

Next Exception: Report ID: graph-ql-66f3e9cea655b; Message: Syntax Error: Unexpected <EOF> in /var/www/html/vendor/magento/framework/GraphQl/Exception/ExceptionFormatter.php:64
Stack trace:
#0 /var/www/html/vendor/magento/module-graph-ql/Controller/GraphQl.php(210): Magento\Framework\GraphQl\Exception\ExceptionFormatter->create(Object(GraphQL\Error\SyntaxError))
#1 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\GraphQl\Controller\GraphQl->dispatch(Object(Magento\Framework\App\Request\Http))
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\GraphQl\Controller\GraphQl\Interceptor->___callParent('dispatch', Array)
#3 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(72): Magento\GraphQl\Controller\GraphQl\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\GraphQl\Controller\GraphQl\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\GraphQl\Controller\GraphQl\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#6 /var/www/html/generated/code/Magento/GraphQl/Controller/GraphQl/Interceptor.php(23): Magento\GraphQl\Controller\GraphQl\Interceptor->___callPlugins('dispatch', Array, Array)
#7 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\GraphQl\Controller\GraphQl\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent('launch', Array)
#10 /var/www/html/vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch(Object(Magento\Framework\App\Http\Interceptor), Object(Closure))
#12 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#13 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, NULL)
#14 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#15 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#16 {main} {"exception":"[object] (Exception(code: 0): Report ID: graph-ql-66f3e9cea655b; Message: Syntax Error: Unexpected <EOF> at /var/www/html/vendor/magento/framework/GraphQl/Exception/ExceptionFormatter.php:64)
[previous exception] [object] (GraphQL\\Error\\SyntaxError(code: 0): Syntax Error: Unexpected <EOF> at /var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php:433)"} []

Expected result

Page loads proper

Actual result

Page loads and i can test query{
"errors": [
{
"message": "Syntax Error: Unexpected <EOF>",
"locations": [
{
"line": 1,
"column": 1
}
],
"extensions": {
"file": "[/var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php](https://app.demo.test/var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php)",
"line": 433
}
}
]
}

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 day ago

Hi @felek000. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.

m2-assistant[bot] commented 1 day ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 18 hours ago

Hi @felek000,

Thanks for your reporting and collaboration.

Could you please let us know for which of the mutation you are facing an issue.Could you please follow the document https://developer.adobe.com/commerce/webapi/graphql/usage/ for the graphql usage and let us know if you are still facing any issue.

Thanks.

felek000 commented 18 hours ago

@engcom-Bravo I want to start fresh app. And check connection using graphql. However on page did see error so I was unable to check any query. When i use example curl to check if any query woks i had positive responce.