Skip to content

Commit 142d2ee

Browse files
committed
fix: remove NotFoundError parameter (#5)
1 parent 9249e65 commit 142d2ee

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/utilities/generateDataLoaderFactory.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ export default (
244244
245245
import {
246246
getByIds,
247-
getByIdsUsingJoiningTable,
248-
NotFoundError
247+
getByIdsUsingJoiningTable
249248
} from 'postloader';
250249
import DataLoader from 'dataloader';
251250
import type {

test/postloader/utilities/generateDataLoaderFactory.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ test('creates a loader for unique indexes', (t) => {
3636
3737
import {
3838
getByIds,
39-
getByIdsUsingJoiningTable,
40-
NotFoundError
39+
getByIdsUsingJoiningTable
4140
} from 'postloader';
4241
import DataLoader from 'dataloader';
4342
import type {
@@ -58,7 +57,7 @@ export type LoadersType = {|
5857
5958
export const createLoaders = (connection: DatabaseConnectionType): LoadersType => {
6059
const FooByBarLoader = new DataLoader((ids) => {
61-
return getByIds(connection, 'foo', ids, 'bar', '"bar"', false, NotFoundError);
60+
return getByIds(connection, 'foo', ids, 'bar', '"bar"', false);
6261
});
6362
6463
return {
@@ -101,8 +100,7 @@ test('creates a loader for unique indexes (uses mappedTableName when available)'
101100
102101
import {
103102
getByIds,
104-
getByIdsUsingJoiningTable,
105-
NotFoundError
103+
getByIdsUsingJoiningTable
106104
} from 'postloader';
107105
import DataLoader from 'dataloader';
108106
import type {
@@ -123,7 +121,7 @@ export type LoadersType = {|
123121
124122
export const createLoaders = (connection: DatabaseConnectionType): LoadersType => {
125123
const BazByBarLoader = new DataLoader((ids) => {
126-
return getByIds(connection, 'foo', ids, 'bar', '"bar"', false, NotFoundError);
124+
return getByIds(connection, 'foo', ids, 'bar', '"bar"', false);
127125
});
128126
129127
return {
@@ -157,8 +155,7 @@ test('creates a loader for _id columns', (t) => {
157155
158156
import {
159157
getByIds,
160-
getByIdsUsingJoiningTable,
161-
NotFoundError
158+
getByIdsUsingJoiningTable
162159
} from 'postloader';
163160
import DataLoader from 'dataloader';
164161
import type {
@@ -179,7 +176,7 @@ export type LoadersType = {|
179176
180177
export const createLoaders = (connection: DatabaseConnectionType): LoadersType => {
181178
const BazsByBarIdLoader = new DataLoader((ids) => {
182-
return getByIds(connection, 'foo', ids, 'bar_id', '"bar_id" "barId"', true, NotFoundError);
179+
return getByIds(connection, 'foo', ids, 'bar_id', '"bar_id" "barId"', true);
183180
});
184181
185182
return {
@@ -240,8 +237,7 @@ test('creates a loader for a join table', (t) => {
240237
241238
import {
242239
getByIds,
243-
getByIdsUsingJoiningTable,
244-
NotFoundError
240+
getByIdsUsingJoiningTable
245241
} from 'postloader';
246242
import DataLoader from 'dataloader';
247243
import type {
@@ -276,10 +272,10 @@ export type LoadersType = {|
276272
277273
export const createLoaders = (connection: DatabaseConnectionType): LoadersType => {
278274
const BarFoosByBarIdLoader = new DataLoader((ids) => {
279-
return getByIds(connection, 'bar_foo', ids, 'bar_id', '"bar_id" "barId", "foo_id" "fooId"', true, NotFoundError);
275+
return getByIds(connection, 'bar_foo', ids, 'bar_id', '"bar_id" "barId", "foo_id" "fooId"', true);
280276
});
281277
const BarFoosByFooIdLoader = new DataLoader((ids) => {
282-
return getByIds(connection, 'bar_foo', ids, 'foo_id', '"bar_id" "barId", "foo_id" "fooId"', true, NotFoundError);
278+
return getByIds(connection, 'bar_foo', ids, 'foo_id', '"bar_id" "barId", "foo_id" "fooId"', true);
283279
});
284280
const FoosByBarIdLoader = new DataLoader((ids) => {
285281
return getByIdsUsingJoiningTable(connection, 'bar_foo', 'foo', 'foo', 'bar', 'r2."id"', ids);

0 commit comments

Comments
 (0)