Class SchemaMappingInspector
inspect(GraphQLSchema, RuntimeWiring)
method that checks
if schema mappings.
Schema mapping checks depend on DataFetcher
s 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 SchemaReport
inspect
(GraphQLSchema schema, RuntimeWiring runtimeWiring) Check the schema againstDataFetcher
registrations, and produce a report.static SchemaReport
inspect
(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> dataFetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)
with a map ofDataFetcher
registrations.
-
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 againstDataFetcher
registrations, and produce a report.- Parameters:
schema
- the schema to inspectruntimeWiring
- forDataFetcher
registrations- Returns:
- the created report
-
inspect
public static SchemaReport inspect(GraphQLSchema schema, Map<String, Map<String, DataFetcher>> dataFetchers) Variant ofinspect(GraphQLSchema, RuntimeWiring)
with a map ofDataFetcher
registrations.- Parameters:
schema
- the schema to inspectdataFetchers
- the map of registeredDataFetcher
instances- Since:
- 1.2.5
-