- Issue created by @Siegrist
- 🇨🇭Switzerland Lukas von Blarer
I'm having this issue as well. @Siegrist have you found a solution to this?
- 🇨🇭Switzerland Lukas von Blarer
Ok, this works as designed. This is the solution to this problem: 🐛 Views - Anonymous User Fixed
I was able to make the code a bit more generic:
/** * Implements hook_ENTITY_TYPE_access(). */ function HOOK_view_access(View $view, $operation, $account) { $route_name = \Drupal::routeMatch()->getRouteName(); if ($operation === 'view' && str_starts_with($route_name, 'graphql.query')) { return AccessResult::allowedIf($view->getExecutable()->access('default', $account)); } return AccessResult::neutral(); }
Maybe that should be documented in the docs here? https://graphql-core-schema.netlify.app/schema-extensions/views.html That's at least where I was looking for why this isn't working.