Exemple #1
0
    public void anon_operation_with_mutation()
    {
        var query = @"
                {
                  fieldA
                }

                mutation Foo {
                  fieldB
                }
                ";

        ShouldFailRule(_ =>
        {
            _.Query = query;
            _.Error(LoneAnonymousOperationError.AnonOperationNotAloneMessage(), 2, 17);
        });
    }
Exemple #2
0
    public void multiple_anon_operations()
    {
        var query = @"
                {
                  fieldA
                }

                {
                  fieldB
                }
                ";

        ShouldFailRule(_ =>
        {
            _.Query = query;
            _.Error(LoneAnonymousOperationError.AnonOperationNotAloneMessage(), 2, 17);
            _.Error(LoneAnonymousOperationError.AnonOperationNotAloneMessage(), 6, 17);
        });
    }