Interface SchemaMappingInspector.Initializer
- Enclosing class:
- SchemaMappingInspector
public static interface SchemaMappingInspector.Initializer
Helps to configure 
SchemaMappingInspector.- Since:
- 1.3.0
- Author:
- Brian Clozel, Rossen Stoyanchev
- 
Method SummaryModifier and TypeMethodDescriptionclassMapping(String graphQlTypeName, Class<?>... aClass) Provide an explicit mapping between a GraphQL type name and the Java class(es) that represent it at runtime to help inspect union member and interface implementation types when those associations cannot be discovered otherwise.classNameFunction(Function<graphql.schema.GraphQLObjectType, String> function) Help to derive thesimple class namefor the Java representation of a GraphQL union member or interface implementing type.Alternative toclassMapping(String, Class[])with a customSchemaMappingInspector.ClassResolverto find the Java class(es) for a GraphQL union member or interface implementation type.inspect(graphql.schema.GraphQLSchema schema, Map<String, Map<String, graphql.schema.DataFetcher>> fetchers) Perform the inspection and return a report.
- 
Method Details- 
classMappingProvide an explicit mapping between a GraphQL type name and the Java class(es) that represent it at runtime to help inspect union member and interface implementation types when those associations cannot be discovered otherwise.Out of the box, there a several ways through which schema inspection can locate such types automatically: - Java class representations are located in the same package as the
 type returned from the controller method for a union or interface field,
 and their simple class namesmatch GraphQL type names, possibly with the help of aclassNameFunction(java.util.function.Function<graphql.schema.GraphQLObjectType, java.lang.String>).
- Java class representations are located in the same package as the declaring class of the controller method for a union or interface field.
- Controller methods return the Java class representations of schema fields for concrete union member or interface implementation types.
 - Parameters:
- graphQlTypeName- the name of a GraphQL Object type
- aClass- one or more Java class representations
- Returns:
- the same initializer instance
 
- Java class representations are located in the same package as the
 type returned from the controller method for a union or interface field,
 and their 
- 
classNameFunctionSchemaMappingInspector.Initializer classNameFunction(Function<graphql.schema.GraphQLObjectType, String> function) Help to derive thesimple class namefor the Java representation of a GraphQL union member or interface implementing type. For more details, seeclassMapping(String, Class[]).By default, GraphQLObjectType.getName()is used.- Parameters:
- function- the function to use
- Returns:
- the same initializer instance
 
- 
classResolverAlternative toclassMapping(String, Class[])with a customSchemaMappingInspector.ClassResolverto find the Java class(es) for a GraphQL union member or interface implementation type.- Parameters:
- resolver- the resolver to use to find associated Java classes
- Returns:
- the same initializer instance
 
- 
inspectSchemaReport inspect(graphql.schema.GraphQLSchema schema, Map<String, Map<String, graphql.schema.DataFetcher>> fetchers) Perform the inspection and return a report.- Parameters:
- schema- the schema to inspect
- fetchers- the registered data fetchers
- Returns:
- the produced report
 
 
-