[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-11-02 Thread Bertrand Delacretaz (Jira)


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

Bertrand Delacretaz commented on SLING-9800:


bq. ...the resource of the request is the Servlet ...

Not sure what this means but what happens under the hood in the 
[DefaultSchemaProvider|https://github.com/apache/sling-org-apache-sling-graphql-core/blob/master/src/main/java/org/apache/sling/graphql/core/schema/DefaultSchemaProvider.java]
 is an internal request to the path of that Resource with a `.GQLschema` 
extension. 

So that Resource should be setup with the appropriate `sling:resourceType` so 
that the correct script or servlet is called to generate the schema.

If that information doesn't help, it would be useful if you can provide a 
Sling-based example that reproduces your issue - and that would belong to a 
different ticket.

> 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)


[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-10-27 Thread Andreas Schaefer (Jira)


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

Andreas Schaefer commented on SLING-9800:
-

[~bdelacretaz] I am working on the AEM GraphQL Persisted Queries and a client 
is calling the PQ servlet instead of an GraphiQL endpoint. So the resource of 
the request is the Servlet and using that resource is not working out 
(DefaultSchemaProvider.getSchema() returns an empty string). When using a Mock 
Resource with these values:

new MockResource(
  "/apps/graphql-enablement/content/endpoint", /* path */
  "graphql-enablement/components/endpoint", /* resourceType */
  null, /* resourceSuperType */
  null, /* metadata */
  resourceResolver,
  new ValueMapDecorator(new HashMap() {{
    put("", "");
  }}), /* properties */
  null /* parent */
);

- Andy

> 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)


[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-10-22 Thread Radu Cotescu (Jira)


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

Radu Cotescu commented on SLING-9800:
-

[~andysch], do you have any updates here? A new test case would help with 
validating your use-case. 

> 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)


[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-10-20 Thread Bertrand Delacretaz (Jira)


[ 
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)


[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-10-12 Thread Radu Cotescu (Jira)


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

Radu Cotescu commented on SLING-9800:
-

I've improved the API based on your suggestions in [commit 
0e0d29d|https://github.com/apache/sling-org-apache-sling-graphql-core/commit/0e0d29da4efda5eec0545fcf76853ab5bef4e2dd].

> 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)


[jira] [Commented] (SLING-9800) Extract a service to be able to execute GraphQL queries directly

2020-10-09 Thread Andreas Schaefer (Jira)


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

Andreas Schaefer commented on SLING-9800:
-

The isValid() is ok but as a caller I would need to have the ability to figure 
out what is wrong. Either the checker returns validation report, provide such 
an object as argument or have a method that provides feedback.

> 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)