Package graphql.schema.idl
Class SchemaGenerator
- java.lang.Object
-
- graphql.schema.idl.SchemaGenerator
-
@PublicApi public class SchemaGenerator extends java.lang.Object
This can generate a working runtime schema from a type registry and runtime wiring
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaGenerator.Options
These options control how the schema generation works
-
Constructor Summary
Constructors Constructor Description SchemaGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraphQLSchema
createdMockedSchema(java.lang.String sdl)
Created a schema from the SDL that is has a mocked runtime.GraphQLSchema
makeExecutableSchema(SchemaGenerator.Options options, TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring)
This will take aTypeDefinitionRegistry
and aRuntimeWiring
and put them together to create a executable schema controlled by the provided options.GraphQLSchema
makeExecutableSchema(TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring)
This will take aTypeDefinitionRegistry
and aRuntimeWiring
and put them together to create a executable schema
-
-
-
Method Detail
-
createdMockedSchema
public static GraphQLSchema createdMockedSchema(java.lang.String sdl)
Created a schema from the SDL that is has a mocked runtime.- Parameters:
sdl
- the SDL to be mocked- Returns:
- a schema with a mocked runtime
- See Also:
RuntimeWiring.MOCKED_WIRING
-
makeExecutableSchema
public GraphQLSchema makeExecutableSchema(TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) throws SchemaProblem
This will take aTypeDefinitionRegistry
and aRuntimeWiring
and put them together to create a executable schema- Parameters:
typeRegistry
- this can be obtained viaSchemaParser.parse(String)
wiring
- this can be built usingRuntimeWiring.newRuntimeWiring()
- Returns:
- an executable schema
- Throws:
SchemaProblem
- if there are problems in assembling a schema such as missing type resolvers or no operations defined
-
makeExecutableSchema
public GraphQLSchema makeExecutableSchema(SchemaGenerator.Options options, TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) throws SchemaProblem
This will take aTypeDefinitionRegistry
and aRuntimeWiring
and put them together to create a executable schema controlled by the provided options.- Parameters:
options
- the controlling optionstypeRegistry
- this can be obtained viaSchemaParser.parse(String)
wiring
- this can be built usingRuntimeWiring.newRuntimeWiring()
- Returns:
- an executable schema
- Throws:
SchemaProblem
- if there are problems in assembling a schema such as missing type resolvers or no operations defined
-
-