Package graphql.schema.idl
Class SchemaParser
- java.lang.Object
-
- graphql.schema.idl.SchemaParser
-
@PublicApi public class SchemaParser extends java.lang.Object
This can take a graphql schema definition and parse it into aTypeDefinitionRegistry
of definitions ready to be placed intoSchemaGenerator
say
-
-
Constructor Summary
Constructors Constructor Description SchemaParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDefinitionRegistry
buildRegistry(Document document)
special method to build directly a TypeDefinitionRegistry from a Document useful for Introspection => IDL (Document) => TypeDefinitionRegistryTypeDefinitionRegistry
parse(java.io.File file)
Parse a file of schema definitions and create aTypeDefinitionRegistry
TypeDefinitionRegistry
parse(java.io.InputStream inputStream)
Parse a inputStream of schema definitions and create aTypeDefinitionRegistry
TypeDefinitionRegistry
parse(java.io.Reader reader)
Parse a reader of schema definitions and create aTypeDefinitionRegistry
TypeDefinitionRegistry
parse(java.io.Reader reader, ParserOptions parserOptions)
Parse a reader of schema definitions and create aTypeDefinitionRegistry
TypeDefinitionRegistry
parse(java.lang.String schemaInput)
Parse a string of schema definitions and create aTypeDefinitionRegistry
TypeDefinitionRegistry
parseImpl(java.io.Reader schemaInput)
-
-
-
Method Detail
-
parse
public TypeDefinitionRegistry parse(java.io.File file) throws SchemaProblem
Parse a file of schema definitions and create aTypeDefinitionRegistry
- Parameters:
file
- the file to parse- Returns:
- registry of type definitions
- Throws:
SchemaProblem
- if there are problems compiling the schema definitions
-
parse
public TypeDefinitionRegistry parse(java.io.InputStream inputStream) throws SchemaProblem
Parse a inputStream of schema definitions and create aTypeDefinitionRegistry
- Parameters:
inputStream
- the inputStream to parse- Returns:
- registry of type definitions
- Throws:
SchemaProblem
- if there are problems compiling the schema definitions
-
parse
public TypeDefinitionRegistry parse(java.io.Reader reader) throws SchemaProblem
Parse a reader of schema definitions and create aTypeDefinitionRegistry
- Parameters:
reader
- the reader to parse- Returns:
- registry of type definitions
- Throws:
SchemaProblem
- if there are problems compiling the schema definitions
-
parse
public TypeDefinitionRegistry parse(java.io.Reader reader, ParserOptions parserOptions) throws SchemaProblem
Parse a reader of schema definitions and create aTypeDefinitionRegistry
- Parameters:
reader
- the reader to parseparserOptions
- the parse options to use while parsing- Returns:
- registry of type definitions
- Throws:
SchemaProblem
- if there are problems compiling the schema definitions
-
parse
public TypeDefinitionRegistry parse(java.lang.String schemaInput) throws SchemaProblem
Parse a string of schema definitions and create aTypeDefinitionRegistry
- Parameters:
schemaInput
- the schema string to parse- Returns:
- registry of type definitions
- Throws:
SchemaProblem
- if there are problems compiling the schema definitions
-
parseImpl
public TypeDefinitionRegistry parseImpl(java.io.Reader schemaInput)
-
buildRegistry
public TypeDefinitionRegistry buildRegistry(Document document)
special method to build directly a TypeDefinitionRegistry from a Document useful for Introspection => IDL (Document) => TypeDefinitionRegistry- Parameters:
document
- containing type definitions- Returns:
- the TypeDefinitionRegistry containing all type definitions from the document
- Throws:
SchemaProblem
- if an error occurs
-
-