public override GraphQLName BeginVisitAlias(GraphQLName alias) { { Tracker.EnterAlias?.Invoke(alias); } return(base.BeginVisitAlias(alias)); }
public override GraphQLName BeginVisitName(GraphQLName name) { { Tracker.EnterName?.Invoke(name); } return(base.BeginVisitName(name)); }
private GraphQLFieldSelection CreateFieldSelection(int start, GraphQLName name, GraphQLName alias) { return(new GraphQLFieldSelection() { Alias = alias, Name = name, Arguments = this.ParseArguments(), Directives = this.ParseDirectives(), SelectionSet = this.Peek(TokenKind.BRACE_L) ? this.ParseSelectionSet() : null, Location = this.GetLocation(start) }); }
private GraphQLFieldSelection CreateFieldSelection(int start, GraphQLName name, GraphQLName?alias, GraphQLComment?comment) { return(new GraphQLFieldSelection { Comment = comment, Alias = alias, Name = name, Arguments = ParseArguments(), Directives = ParseDirectives(), SelectionSet = Peek(TokenKind.BRACE_L) ? ParseSelectionSet() : null, Location = GetLocation(start) }); }
public static string MustBeValidGraphQLName(this string name, string paramName) { name = name?.Trim(); if (!string.IsNullOrWhiteSpace(name) && !GraphQLName.IsValid(name)) { throw new ArgumentException("Provided name does not comply with GraphQL's Name specification.", paramName) { HelpLink = "https://spec.graphql.org/June2018/#Name" }; } return(name); }
private GraphQLFieldSelection ParseFieldSelection() { var start = this.currentToken.Start; var nameOrAlias = this.ParseName(); GraphQLName name = null; GraphQLName alias = null; if (this.Skip(TokenKind.COLON)) { name = this.ParseName(); alias = nameOrAlias; } else { alias = null; name = nameOrAlias; } return(this.CreateFieldSelection(start, name, alias)); }
private string PrintName(GraphQLName name) { return(name?.Value ?? string.Empty); }
public NameNode Name(GraphQLName name) { return(new NameNode(name.Value).WithLocation(name, _body)); }
private ASTNode CreateOperationDefinition(int start, OperationType operation, GraphQLName name) { return(new GraphQLOperationDefinition() { Operation = operation, Name = name, VariableDefinitions = this.ParseVariableDefinitions(), Directives = this.ParseDirectives(), SelectionSet = this.ParseSelectionSet(), Location = this.GetLocation(start) }); }
private ASTNode CreateOperationDefinition(int start, OperationType operation, GraphQLName name) { var comment = GetComment(); return(new GraphQLOperationDefinition { Comment = comment, Operation = operation, Name = name, VariableDefinitions = ParseVariableDefinitions(), Directives = ParseDirectives(), SelectionSet = ParseSelectionSet(), Location = GetLocation(start) }); }
public virtual GraphQLName BeginVisitAlias(GraphQLName alias) { return(alias); }
public virtual GraphQLName BeginVisitName(GraphQLName name) { return(name); }
public virtual GraphQLName BeginVisitAlias(GraphQLName alias) => alias;
public virtual GraphQLName BeginVisitName(GraphQLName name) => name;