diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts index bcf9978ef90..cb60a66c6e1 100644 --- a/src/__tests__/ApolloClient.ts +++ b/src/__tests__/ApolloClient.ts @@ -2515,6 +2515,36 @@ describe("ApolloClient", () => { }); } }); + + it("reports complete as false when `from` is not identifiable", async () => { + const cache = new InMemoryCache(); + const client = new ApolloClient({ + cache, + link: ApolloLink.empty(), + }); + const ItemFragment = gql` + fragment ItemFragment on Item { + id + text + } + `; + + const observable = client.watchFragment({ + fragment: ItemFragment, + from: {}, + }); + + const stream = new ObservableStream(observable); + + { + const result = await stream.takeNext(); + + expect(result).toStrictEqual({ + data: {}, + complete: false, + }); + } + }); }); describe("defaultOptions", () => {