def test_allows_inline_typeless_fragments():
    expect_passes_rule_with_schema(schema, OverlappingFieldsCanBeMerged, '''
    {
        a
        ... {
            a
        }
    }
    ''')
def test_allows_inline_typeless_fragments():
    expect_passes_rule_with_schema(
        schema, OverlappingFieldsCanBeMerged, '''
    {
        a
        ... {
            a
        }
    }
    ''')
def test_ignores_unknown_types():
    expect_passes_rule_with_schema(schema, OverlappingFieldsCanBeMerged, '''
    {
        boxUnion {
            ...on UnknownType {
                scalar
            }
            ...on NonNullStringBox2 {
                scalar
            }
        }
    }
    ''')
def test_same_wrapped_scalar_return_types():
    expect_passes_rule_with_schema(schema, OverlappingFieldsCanBeMerged, '''
    {
        boxUnion {
            ...on NonNullStringBox1 {
              scalar
            }
            ...on NonNullStringBox2 {
              scalar
            }
        }
    }
    ''')
def test_ignores_unknown_types():
    expect_passes_rule_with_schema(
        schema, OverlappingFieldsCanBeMerged, '''
    {
        boxUnion {
            ...on UnknownType {
                scalar
            }
            ...on NonNullStringBox2 {
                scalar
            }
        }
    }
    ''')
def test_same_wrapped_scalar_return_types():
    expect_passes_rule_with_schema(
        schema, OverlappingFieldsCanBeMerged, '''
    {
        boxUnion {
            ...on NonNullStringBox1 {
              scalar
            }
            ...on NonNullStringBox2 {
              scalar
            }
        }
    }
    ''')
def test_allows_differing_return_types_which_cannot_overlap():
    expect_passes_rule_with_schema(
        schema, OverlappingFieldsCanBeMerged, '''
    {
        someBox {
            ...on IntBox {
                scalar
            }
            ...on StringBox {
                scalar
            }
        }
    }
    ''')
def test_allows_overlapping_types_that_are_interfaces():
    expect_passes_rule_with_schema(
        schema, OverlappingFieldsCanBeMerged, '''
    {
        parent {
            ... on TestParentInterface {
                testField {
                    testChildField
                }
            }
            testField {
                testChildField
            }
        }
    }
    ''')