Exemplo n.º 1
0
        public override GraphQLName BeginVisitAlias(GraphQLName alias)
        {
            {
                Tracker.EnterAlias?.Invoke(alias);
            }

            return(base.BeginVisitAlias(alias));
        }
Exemplo n.º 2
0
        public override GraphQLName BeginVisitName(GraphQLName name)
        {
            {
                Tracker.EnterName?.Invoke(name);
            }

            return(base.BeginVisitName(name));
        }
Exemplo n.º 3
0
 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)
     });
 }
Exemplo n.º 4
0
 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)
     });
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
 private string PrintName(GraphQLName name)
 {
     return(name?.Value ?? string.Empty);
 }
 public NameNode Name(GraphQLName name)
 {
     return(new NameNode(name.Value).WithLocation(name, _body));
 }
Exemplo n.º 9
0
 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)
            });
        }
Exemplo n.º 11
0
 public virtual GraphQLName BeginVisitAlias(GraphQLName alias)
 {
     return(alias);
 }
Exemplo n.º 12
0
 public virtual GraphQLName BeginVisitName(GraphQLName name)
 {
     return(name);
 }
Exemplo n.º 13
0
 public virtual GraphQLName BeginVisitAlias(GraphQLName alias) => alias;
Exemplo n.º 14
0
 public virtual GraphQLName BeginVisitName(GraphQLName name) => name;