Class SchemaMappingInspector
inspect(GraphQLSchema, RuntimeWiring) method that checks
if schema mappings.
Schema mapping checks depend on DataFetchers to be
SelfDescribingDataFetcher in order to compare schema type and Java
object type structure. If a DataFetcher does not implement this
interface, then the Java type remains unknown, and the field type is reported
as "skipped".
The SelfDescribingDataFetcher for an annotated controller method
derives type information from the controller method signature. If the declared
return type is Object, or an unspecified generic parameter such as
List<?> then the Java type structure remains unknown, and the field
output type is reported as skipped.
Unions are always skipped because there is no way for an annotated controller method to express that in a return type, and the Java type structure remains unknown.
Interfaces are supported only as far as fields declared directly on the
interface, which are compared against properties of the Java type declared
by a SelfDescribingDataFetcher.
- Since:
- 1.2.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionPerform an inspection and create aSchemaReport.static SchemaReportinspect(GraphQLSchema schema, RuntimeWiring runtimeWiring) Check the schema againstDataFetcherregistrations, and produce a report.static SchemaReportinspect(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> dataFetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)with a map ofDataFetcherregistrations.
-
Method Details
-
getOrCreateReport
Perform an inspection and create aSchemaReport. The inspection is one once only, during the first call to this method. -
inspect
Check the schema againstDataFetcherregistrations, and produce a report.- Parameters:
schema- the schema to inspectruntimeWiring- forDataFetcherregistrations- Returns:
- the created report
-
inspect
public static SchemaReport inspect(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> dataFetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)with a map ofDataFetcherregistrations.- Parameters:
schema- the schema to inspectdataFetchers- the map of registeredDataFetcherinstances- Since:
- 1.2.5
-