Search in sources :

Example 1 with Introspection.__Schema

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));
}
Also used : GraphQLSchemaElement(graphql.schema.GraphQLSchemaElement) GraphQLCodeRegistry(graphql.schema.GraphQLCodeRegistry) Node(graphql.language.Node) SchemaTransformer(graphql.schema.SchemaTransformer) GraphQLString(graphql.Scalars.GraphQLString) GraphQLDirectiveContainer(graphql.schema.GraphQLDirectiveContainer) TraversalControl(graphql.util.TraversalControl) ValuesResolver(graphql.execution.ValuesResolver) Introspection.__Type(graphql.introspection.Introspection.__Type) GraphQLType(graphql.schema.GraphQLType) TraverserContext(graphql.util.TraverserContext) GraphQLList.list(graphql.schema.GraphQLList.list) GraphQLAppliedDirective(graphql.schema.GraphQLAppliedDirective) InputValueWithState(graphql.schema.InputValueWithState) Introspection.__EnumValue(graphql.introspection.Introspection.__EnumValue) Assert.assertShouldNeverHappen(graphql.Assert.assertShouldNeverHappen) GraphQLNonNull.nonNull(graphql.schema.GraphQLNonNull.nonNull) DataFetcher(graphql.schema.DataFetcher) GraphQLSchema(graphql.schema.GraphQLSchema) GraphQLAppliedDirectiveArgument(graphql.schema.GraphQLAppliedDirectiveArgument) DirectivesUtil(graphql.DirectivesUtil) GraphQLObjectType(graphql.schema.GraphQLObjectType) GraphQLDirective(graphql.schema.GraphQLDirective) ImmutableSet(com.google.common.collect.ImmutableSet) PublicSpi(graphql.PublicSpi) CONTINUE(graphql.util.TraversalControl.CONTINUE) Set(java.util.Set) GraphQLTypeVisitorStub(graphql.schema.GraphQLTypeVisitorStub) FieldCoordinates.coordinates(graphql.schema.FieldCoordinates.coordinates) Introspection.__Schema(graphql.introspection.Introspection.__Schema) AstPrinter(graphql.language.AstPrinter) Introspection.__InputValue(graphql.introspection.Introspection.__InputValue) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) PublicApi(graphql.PublicApi) Assert.assertNotNull(graphql.Assert.assertNotNull) GraphQLObjectType.newObject(graphql.schema.GraphQLObjectType.newObject) Introspection.__Field(graphql.introspection.Introspection.__Field) NotNull(org.jetbrains.annotations.NotNull) GraphQLCodeRegistry(graphql.schema.GraphQLCodeRegistry) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList)

Aggregations

ImmutableSet (com.google.common.collect.ImmutableSet)1 Assert.assertNotNull (graphql.Assert.assertNotNull)1 Assert.assertShouldNeverHappen (graphql.Assert.assertShouldNeverHappen)1 DirectivesUtil (graphql.DirectivesUtil)1 PublicApi (graphql.PublicApi)1 PublicSpi (graphql.PublicSpi)1 GraphQLString (graphql.Scalars.GraphQLString)1 ValuesResolver (graphql.execution.ValuesResolver)1 Introspection.__EnumValue (graphql.introspection.Introspection.__EnumValue)1 Introspection.__Field (graphql.introspection.Introspection.__Field)1 Introspection.__InputValue (graphql.introspection.Introspection.__InputValue)1 Introspection.__Schema (graphql.introspection.Introspection.__Schema)1 Introspection.__Type (graphql.introspection.Introspection.__Type)1 AstPrinter (graphql.language.AstPrinter)1 Node (graphql.language.Node)1 DataFetcher (graphql.schema.DataFetcher)1 FieldCoordinates.coordinates (graphql.schema.FieldCoordinates.coordinates)1 GraphQLAppliedDirective (graphql.schema.GraphQLAppliedDirective)1 GraphQLAppliedDirectiveArgument (graphql.schema.GraphQLAppliedDirectiveArgument)1 GraphQLCodeRegistry (graphql.schema.GraphQLCodeRegistry)1