

def test_executes_interface_types_with_inline_fragment():
    ast = parse('\n      {\n        __typename\n        name\n        friends {\n          __typename\n          name\n          ... on Dog {\n            barks\n          }\n          ... on Cat {\n            meows\n          }\n        }\n      }\n    ')
    result = execute(schema, john, ast)
    assert (not result.errors)
    assert (result.data == {
        '__typename': 'Person',
        'name': 'John',
        'friends': [{
            '__typename': 'Person',
            'name': 'Liz',
        }, {
            '__typename': 'Dog',
            'name': 'Odie',
            'barks': True,
        }],
    })

dataset/ETHPy150Open graphql-python/graphql-core/tests/core_execution/test_union_interface.py test_executes_interface_types_with_inline_fragment/original