Class Parser

  • Direct Known Subclasses:
    NodeToRuleCapturingParser

    @PublicApi
    public class Parser
    extends java.lang.Object
    This can parse graphql syntax, both Query syntax and Schema Definition Language (SDL) syntax, into an Abstract Syntax Tree (AST) represented by a Document

    You should not generally need to call this class as the GraphQL code sets this up for you but if you are doing specific graphql utilities this class is essential.

    Graphql syntax has a series of characters, such as spaces, new lines and commas that are not considered relevant to the syntax. However they can be captured and associated with the AST elements they belong to.

    This costs more memory but for certain use cases (like editors) this maybe be useful. We have chosen to no capture ignored characters by default but you can turn this on, either per parse or statically for the whole JVM via ParserOptions.setDefaultParserOptions(ParserOptions) ()}}

    See Also:
    IgnoredChar