use of graphql.introspection.Introspection.__Schema in project graphql-java by graphql-java.
the class IntrospectionWithDirectivesSupport method addDirectiveDefinitionFilter.
private GraphQLSchema addDirectiveDefinitionFilter(GraphQLSchema schema) {
DataFetcher<?> df = env -> {
List<GraphQLDirective> definedDirectives = env.getGraphQLSchema().getDirectives();
return filterDirectives(schema, true, null, definedDirectives);
};
GraphQLCodeRegistry codeRegistry = schema.getCodeRegistry().transform(bld -> bld.dataFetcher(coordinates(__Schema, "directives"), df));
return schema.transform(bld -> bld.codeRegistry(codeRegistry));
}
Aggregations