[
https://issues.apache.org/jira/browse/SLING-10619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17385361#comment-17385361
]
Radu Cotescu edited comment on SLING-10619 at 7/22/21, 9:05 AM:
----------------------------------------------------------------
{quote}Do you envision generating those capabilities automatically at build
time?{quote}
Yes, with a Maven or even better a BND plugin.
b) can be achieved just by looking at a project's file structure: have a look
at [https://github.com/apache/sling-scriptingbundle-maven-plugin] for code, or
[https://sling.apache.org/components/scriptingbundle-maven-plugin/usage.html]
for documentation.
We don't need the {{Sling-GraphQL-Schema}} bundle header if we have the
capabilities I mentioned.
I agree with the comment about the tooling:
# it should validate the syntax
# it should generate all the OSGi info
# it should help with testing, by generating full schemas
was (Author: radu.cotescu):
{quote}Do you envision generating those capabilities automatically at build
time?{quote}
Yes, with a Maven or even better a BND plugin.
b) can be achieved without a) - have a look at
[https://github.com/apache/sling-scriptingbundle-maven-plugin] for code, or
[https://sling.apache.org/components/scriptingbundle-maven-plugin/usage.html]
for documentation.
> Remove sling.graphql-schema-aggregator capability if not useful
> ---------------------------------------------------------------
>
> Key: SLING-10619
> URL: https://issues.apache.org/jira/browse/SLING-10619
> Project: Sling
> Issue Type: Improvement
> Components: GraphQL
> Reporter: Bertrand Delacretaz
> Priority: Minor
> Fix For: GraphQL Schema Aggregator 0.0.2
>
>
> The {{ProviderBundleTracker}} currently requires provider bundles to define
> an [OSGi
> capability|https://github.com/apache/sling-org-apache-sling-graphql-schema-aggregator/blob/04474a2fe16389c0df60471922f38e7dcfc637ef/src/main/java/org/apache/sling/graphql/schema/aggregator/impl/ProviderBundleTracker.java#L48],
> I think the idea is for that class to efficiently ignore bundles which are
> not provider bundles.
> However I don't think this is more efficient than just having
> {{addingBundle(...)}} test for the {{Sling-GraphQL-Schema}} header.
> I would argue that doing the following in that method would be at least as
> efficient than the current code in terms of ignoring non-provider bundles:
> {code:java}
> @Override
> public Object addingBundle(Bundle bundle, BundleEvent event) {
> final String providersPath =
> bundle.getHeaders().get("Sling-GraphQL-Schema");
> if (providersPath == null) {
> // not interested in that bundle
> return;
> ...
> {code}
> Currently, requiring this capability means provider bundles must declare both
> the {{Sling-GraphQL-Schema}} header and the
> {{sling.graphql-schema-aggregator}} capability.
> Unless there are definite advantages in having both, I'd be in favor of
> requiring just the {{Sling-GraphQL-Schema}} header to keep things as simple
> as possible.
> [~radu] I know you were in favor of using the capability, if we agree that
> the above code has no performance impact, do you see another benefit of using
> the capability?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)