Skip to content

Commit

Permalink
fix: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
fratzinger committed Jan 16, 2024
1 parent 3e67c16 commit b1b1b06
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"update-dependencies": "ncu -u -x ajv",
"test:unit": "vitest run",
"coverage": "vitest run --coverage",
"test": "npm run lint && npm run test:unit"
"test": "npm run lint && npm run coverage"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function cache<H extends HookContext = HookContext, T = any>(
return context;
case 'get': {
if (!Object.keys(query).length) {
const key = makeCacheKey(context.id);
const key = makeCacheKey(context.id!);
const value = cacheMap.get(key);
if (value) context.result = value;
}
Expand Down
21 changes: 9 additions & 12 deletions src/hooks/fgraphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,15 @@ export function fgraphql<H extends HookContext = HookContext>(options1: FGraphQL

let ourResolvers: any; // will be initialized when hook is first called

const options = Object.assign(
{},
{
skipHookWhen: (context: any) => !!(context.params || {}).graphql,
inclAllFieldsServer: true,
inclAllFieldsClient: true,
inclAllFields: null, // Will be initialized each hook call.
inclJoinedNames: true,
extraAuthProps: [],
},
options1.options || {},
);
const options = {
skipHookWhen: (context: any) => !!(context.params || {}).graphql,
inclAllFieldsServer: true,
inclAllFieldsClient: true,
inclAllFields: null, // Will be initialized each hook call.
inclJoinedNames: true,
extraAuthProps: [],
...(options1.options || {}),
};

// @ts-ignore
schema = isFunction(schema) ? schema() : schema;
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/populate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function populate<H extends HookContext = HookContext>(options: PopulateO
throw new BadRequest('Schema does not resolve to an object. (populate)');
}

const include = [].concat(schema1.include || []).map(schema => {
const include = [].concat((schema1.include || []) as any).map(schema => {
if ('provider' in schema) {
return schema;
} else {
Expand Down Expand Up @@ -174,11 +174,11 @@ function populateItem(

const elapsed: any = {};
const startAtAllIncludes = new Date().getTime();
const include = [].concat(includeSchema || []);
const include = [].concat(includeSchema || []) as any;
if (!Object.prototype.hasOwnProperty.call(item, '_include')) item._include = [];

return Promise.all(
include.map(childSchema => {
include.map((childSchema: any) => {
const { query, select, parentField } = childSchema;

// A related column join is required if neither the query nor select options are provided.
Expand Down

0 comments on commit b1b1b06

Please sign in to comment.