drupal-graphql / drupal-graphql/graphql

Argument #1 ($corsOptions) must be of type array, Drupal\\Core\\Http\\RequestStack given

Open
#1,381 2 comments 0 reactions 0 assignees View on GitHub
4.x
Dominant language
PHP
Stars
287
Forks
198
PR merge metrics
No merged PRs in 30d

Description

Recording this here. I'm getting an error with version 4.6 which causes my build to fail. I can't reproduce this on my local dev yet and haven't been able to dig in to it yet. I thought it was caused by an old configuration for a graphql site but have recreated this and it still fails.

I am using a custom schema written over a year ago so will try removing that to see if the issue persists.

Rolling back to 4.5 solves my issue.

```
TypeError: Drupal\\graphql\\Routing\\QueryRouteEnhancer::__construct(): Argument #1 ($corsOptions) must be of type array, Drupal\\Core\\Http\\RequestStack given, called in /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in /opt/drupal/web/modules/contrib/graphql/src/Routing/QueryRouteEnhancer.php on line 30 #0 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\\graphql\\Routing\\QueryRouteEnhancer->__construct()
#1 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService()
#2 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\\Component\\DependencyInjection\\Container->get()
#3 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters()
#4 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService()
#5 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\\Component\\DependencyInjection\\Container->get()
#6 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters()
#7 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService()
#8 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\\Component\\DependencyInjection\\Container->get()
#9 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters()
#10 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService()
#11 /opt/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(136): Drupal\\Component\\DependencyInjection\\Container->get()
#12 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(145): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch()
#13 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw()
#14 /opt/drupal/web/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handle()
#15 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle()
#16 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle()
#17 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle()
#18 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\\page_cache\\StackMiddleware\\PageCache->fetch()
#19 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\\page_cache\\StackMiddleware\\PageCache->lookup()
#20 /opt/drupal/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\\page_cache\\StackMiddleware\\PageCache->handle()
#21 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\\Stack\\Cors->handle()
#22 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle()
#23 /opt/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\
egotiationMiddleware->handle()
#24 /opt/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\\StackedHttpKernel->handle()
#25 /opt/drupal/web/index.php(19): Drupal\\Core\\DrupalKernel->handle()
#26 {main}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.