Class SchemaMappingInspector
java.lang.Object
org.springframework.graphql.execution.SchemaMappingInspector
Inspect schema mappings on startup to ensure the following:
 
- Schema fields have either a DataFetcherregistration or a corresponding Class property.
- DataFetcherregistrations refer to a schema field that exists.
- DataFetcherarguments have matching schema field arguments.
Use methods of GraphQlSource.SchemaResourceBuilder to enable schema
 inspection on startup. For all other cases, use initializer() as a
 starting point or the shortcut inspect(GraphQLSchema, Map).
- Since:
- 1.2.0
- Author:
- Brian Clozel, Rossen Stoyanchev
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceStrategy to resolve the Java class(es) for aGraphQLObjectType, effectively the reverse ofTypeResolver, for schema inspection purposes.static interfaceHelps to configureSchemaMappingInspector.
- 
Method SummaryModifier and TypeMethodDescriptionPerform an inspection and create aSchemaReport.Return an initializer to configure theSchemaMappingInspectorand perform the inspection.static SchemaReportinspect(GraphQLSchema schema, RuntimeWiring runtimeWiring) Check the schema againstDataFetcherregistrations, and produce a report.static SchemaReportinspect(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> fetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)with a map ofDataFetcherregistrations.
- 
Method Details- 
getOrCreateReportPerform an inspection and create aSchemaReport. The inspection is done once only, during the first call to this method.
- 
inspectCheck the schema againstDataFetcherregistrations, and produce a report.- Parameters:
- schema- the schema to inspect
- runtimeWiring- for- DataFetcherregistrations
- Returns:
- the created report
 
- 
inspectpublic static SchemaReport inspect(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> fetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)with a map ofDataFetcherregistrations.- Parameters:
- schema- the schema to inspect
- fetchers- the map of- DataFetcherregistrations
- Since:
- 1.2.5
 
- 
initializerReturn an initializer to configure theSchemaMappingInspectorand perform the inspection.- Since:
- 1.3.0
 
 
-