[ 
https://issues.apache.org/jira/browse/SLING-9800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17217475#comment-17217475
 ] 

Bertrand Delacretaz commented on SLING-9800:
--------------------------------------------

bq. The QueryExecutor.execute() and .validate() is requiring a Resource 
(queryResource) which must be a resource that points to the Endpoint

What makes you think this is the case, do you have an example failing test 
where that Resource is a valid one that points to something else than the 
endpoint? Assuming by endpoint you mean the Resource that points to the 
GraphQLServlet.

The Resource that these methods take is used as follows:
* To establish the request's identity
* To generate the Schema, by making a request to that Resource with the 
{{.GQLschema}} extension.

As long as the Resource that you pass works for these purposes you should be 
fine. Maybe the one you're passing has the wrong {{sling:resourceType}} and 
causes an incorrect schema to be generated?

bq.  I would suggest to the user provides the path to the GraphQL Endpoint as a 
string and the DefaultSchemaProvider is creating an internal resource.

That would lose the incoming request's identity information. We need to relay 
that all the way to the query's execution and data retrieval, to be able to use 
the built-in access control mechanisms.

> Extract a service to be able to execute GraphQL queries directly
> ----------------------------------------------------------------
>
>                 Key: SLING-9800
>                 URL: https://issues.apache.org/jira/browse/SLING-9800
>             Project: Sling
>          Issue Type: Improvement
>          Components: GraphQL
>            Reporter: Radu Cotescu
>            Assignee: Radu Cotescu
>            Priority: Major
>             Fix For: GraphQL Core 0.0.8
>
>
> In the current implementation of the GraphQL Core bundle queries can only be 
> executed via a GraphQL Servlet that needs to be configured or via server-side 
> scripts. It would be good if the queries could also be executed directly, 
> without the need for a request.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to