Exemplo n.º 1
0
 /// <summary>
 /// Given a string containing a GraphQL value, parse the AST for that value.
 /// Throws GraphQLError if a syntax error is encountered.
 ///
 /// This is useful within tools that operate upon GraphQL Values directly and
 /// in isolation of complete GraphQL documents.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static IValue ParseValue(Source source, ParseOptions options = null)
 {
     var parser = new Parser(source, options);
     return parser.ParseValueLiteral(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Given a GraphQL source, parses it into a Document.
 /// Throws GraphQLError if a syntax error is encountered.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static Document Parse(Source source, ParseOptions options = null)
 {
     var parser = new Parser(source, options);
     return parser.ParseDocument();
 }