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.
- The nullness of DataFetcherreturn types, class properties or class methods match, or is more restrictive than, the nullness of schema fields.
- The nullness of DataFetcherarguments match, or is more restrictive than, the nullness of schema argument types.
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(graphql.schema.GraphQLSchema schema, graphql.schema.idl.RuntimeWiring runtimeWiring) Check the schema againstDataFetcherregistrations, and produce a report.static SchemaReportinspect(graphql.schema.GraphQLSchema schema, Map<String, Map<String, graphql.schema.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.
- 
inspectpublic static SchemaReport inspect(graphql.schema.GraphQLSchema schema, graphql.schema.idl.RuntimeWiring runtimeWiring) Check the schema againstDataFetcherregistrations, and produce a report.- Parameters:
- schema- the schema to inspect
- runtimeWiring- for- DataFetcherregistrations
- Returns:
- the created report
 
- 
inspectpublic static SchemaReport inspect(graphql.schema.GraphQLSchema schema, Map<String, Map<String, graphql.schema.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
 
 
-