Open d0t15t opened 6 years ago
User need permission to read node_article
Sorry i forgot to mention, the user has the permission: "View published content" (There are no node level view permissions in core drupal). The user can view all the same nodes as the admin, yet gets empty results in Graphiql. When i assign the test role the permission "Administer content", then it receives the expected results in Graphiql.
You can try to run entity_access('view', 'node', $node)
. All thing related to permissions is checked through entity_access($op, $entity_type, $entity)
.
https://github.com/olragon/graphql_api/blob/master/src/Schema.php#L336:24
I've created a role 'api' and assigned it to 'Use GraphQL query' in Drupal-Permissions. The user can then reach the /graphql/graphiql page, but queries return only empty results. When logged in as an admin, the same query returns all nodes as expected.