예제 #1
0
 public virtual VisitorAction Leave(
     EnumValueNode node,
     ISyntaxNode parent,
     IReadOnlyList <object> path,
     IReadOnlyList <ISyntaxNode> ancestors)
 {
     return(GetDefaultAction(node.Kind));
 }
예제 #2
0
        /// <summary>
        /// Determines whether the specified <see cref="EnumValueNode"/>
        /// is equal to the current <see cref="EnumValueNode"/>.
        /// </summary>
        /// <param name="other">
        /// The <see cref="EnumValueNode"/> to compare with the current
        /// <see cref="EnumValueNode"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="EnumValueNode"/> is equal
        /// to the current <see cref="EnumValueNode"/>;
        /// otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(EnumValueNode other)
        {
            if (other is null)
            {
                return(false);
            }

            if (ReferenceEquals(other, this))
            {
                return(true);
            }

            return(other.Value.Equals(Value, StringComparison.Ordinal));
        }
        public void EnumArg(string arg)
        {
            // arrange
            byte[] sourceText = Encoding.UTF8.GetBytes(
                "{ a(b:" + arg + ") }");

            // acts
            var parser = new Utf8GraphQLParser(
                sourceText, ParserOptions.Default);
            DocumentNode document = parser.Parse();

            // assert
            EnumValueNode value = Assert.IsType <EnumValueNode>(
                document.Definitions.OfType <OperationDefinitionNode>().First()
                .SelectionSet.Selections.OfType <FieldNode>().First()
                .Arguments.First().Value);

            Assert.Equal(arg, value.Value);
        }
예제 #4
0
 protected virtual EnumValueNode RewriteEnumValue(
     EnumValueNode node,
     TContext context)
 {
     return(node);
 }
예제 #5
0
 protected override void VisitEnumValue(EnumValueNode node)
 {
     _writer.Write(node.Value);
 }
예제 #6
0
 protected virtual void VisitEnumValue(EnumValueNode node)
 {
 }
 public static void WriteEnumValue(
     this DocumentWriter writer,
     EnumValueNode node)
 {
     writer.Write(node.Value);
 }
예제 #8
0
 protected virtual void VisitEnumValue(
     EnumValueNode node,
     TContext context)
 {
 }