Skip to content

Commit

Permalink
More (non-throwing) tests of assertSelectionSetForIdValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Aug 8, 2019
1 parent a263eef commit 3c6b155
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/apollo-cache-inmemory/src/__tests__/readFromStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,5 +817,48 @@ describe('reading from the store', () => {
}).toThrow(
/Missing selection set for object of type Publisher returned for query field books/,
);

expect(
reader.readQueryFromStore({
store,
query: gql`
{
author {
name
books {
title
publisher {
name
}
}
}
}
`,
}),
).toEqual({
author: {
name: 'Toni Morrison',
books: [
{
title: 'The Bluest Eye',
publisher: {
name: 'Holt, Rinehart and Winston',
},
},
{
title: 'Song of Solomon',
publisher: {
name: 'Alfred A. Knopf, Inc.',
},
},
{
title: 'Beloved',
publisher: {
name: 'Alfred A. Knopf, Inc.',
},
},
],
},
});
});
});

0 comments on commit 3c6b155

Please sign in to comment.