Skip to content

Commit

Permalink
always use entire field node as cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbol committed Apr 18, 2023
1 parent fb7a24d commit 071ac34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/batch-delegate/src/getLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function getLoader<K = any, V = any, C = K>(options: BatchDelegateOptions

let cacheKey = fieldName;

if (fieldNodes[0]?.selectionSet != null) {
if (fieldNodes[0]) {
const fieldNode = {
...fieldNodes[0],
alias: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/batch-delegate/tests/basic.example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('batch delegation within basic stitching example', () => {
expect(chirps[0].chirpedAtUser.email).not.toBe(null);
});

test.only('uses a single call even when delegating the same field multiple times', async () => {
test('uses a single call even when delegating the same field multiple times', async () => {
let numCalls = 0;

const chirpSchema = makeExecutableSchema({
Expand Down

0 comments on commit 071ac34

Please sign in to comment.