From 8791be8eb5fa547f386150ea9a1dce7311e04c4e Mon Sep 17 00:00:00 2001 From: David Yahalomi Date: Fri, 7 Oct 2016 13:20:20 +0300 Subject: [PATCH] * Added failing test for issue #739 --- test/roundtrip.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/roundtrip.ts b/test/roundtrip.ts index 57ea3ac8cae..b0ab9ac5c12 100644 --- a/test/roundtrip.ts +++ b/test/roundtrip.ts @@ -141,6 +141,31 @@ describe('roundtrip', () => { }); }); + it('should resolve fields it can on interface with non matching inline fragments', () => { + storeRoundtrip(gql` + query { + dark_forces { + __typename + name + ... on Droid { + model + } + } + }`, { + dark_forces: [ + { + __typename: 'Droid', + name: '8t88', + model: '88', + }, + { + __typename: 'Darth', + name: 'Anakin Skywalker', + }, + ], + }); + }); + it('should throw an error on two of the same inline fragment types', () => { assert.throws(() => { storeRoundtrip(gql`