private DataFetcher getDataFetcher()

in src/main/java/org/apache/sling/graphql/core/engine/DefaultQueryExecutor.java [305:318]


    private DataFetcher<Object> getDataFetcher(FieldDefinition field, Resource currentResource) {
        DataFetcher<Object> result = null;
        final Directive d = field.getDirectives().stream().filter( i -> FETCHER_DIRECTIVE.equals(i.getName())).findFirst().orElse(null);
        if (d != null) {
            final String name = validateFetcherName(getDirectiveArgumentValue(d, FETCHER_NAME));
            final String options = getDirectiveArgumentValue(d, FETCHER_OPTIONS);
            final String source = getDirectiveArgumentValue(d, FETCHER_SOURCE);
            SlingDataFetcher<Object> f = dataFetcherSelector.getSlingFetcher(name);
            if (f != null) {
                result = new SlingDataFetcherWrapper<>(f, currentResource, options, source);
            }
        }
        return result;
    }