Skip to content

Commit 6d4a356

Browse files
committed
Fix loadSiblings file location
1 parent 5ff184b commit 6d4a356

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.changeset/hot-shoes-return.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': patch
3+
---
4+
5+
Fix loadSiblings file location

packages/plugin/src/sibling-operations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function loadSiblings(baseDir: string, loadPaths: string[]): Source[] {
5050
return loadDocumentsSync(loadPaths, {
5151
cwd: baseDir,
5252
loaders: operationsLoaders,
53-
}).map(r => ({ ...r, location: join(baseDir, r.location) }));
53+
});
5454
}
5555

5656
const operationsCache: Map<string, Source[]> = new Map();
@@ -120,8 +120,8 @@ export function getSiblingOperations(options: ParserOptions, gqlConfig: GraphQLC
120120
// Since the siblings array is cached, we can use it as cache key.
121121
// We should get the same array reference each time we get
122122
// to this point for the same graphql project
123-
if(siblingOperationsCache.has(siblings)) {
124-
return siblingOperationsCache.get(siblings)
123+
if (siblingOperationsCache.has(siblings)) {
124+
return siblingOperationsCache.get(siblings);
125125
}
126126

127127
let fragmentsCache: FragmentSource[] | null = null;
@@ -216,6 +216,6 @@ export function getSiblingOperations(options: ParserOptions, gqlConfig: GraphQLC
216216
getOperationByType: type => getOperations().filter(o => o.document.operation === type),
217217
getFragmentsInUse: (selectable, recursive = true) => Array.from(collectFragments(selectable, recursive).values()),
218218
};
219-
siblingOperationsCache.set(siblings, siblingOperations)
220-
return siblingOperations
219+
siblingOperationsCache.set(siblings, siblingOperations);
220+
return siblingOperations;
221221
}

0 commit comments

Comments
 (0)