Skip to content

Commit

Permalink
Merge pull request #16 from networkteam/next
Browse files Browse the repository at this point in the history
loadQueryResult: Fix type argument order / Make params optional
  • Loading branch information
esdete2 authored Sep 30, 2024
2 parents 360dd0b + 20a0660 commit 88a6711
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/utils/dataLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ export const loadSiteProps = async <CustomSiteData extends SiteData = SiteData>(
return data;
};

export const loadQueryResult = async <M, D>(
export const loadQueryResult = async <D, M>(
queryName: string,
params: any,
params?: any,
opts?: DataLoaderOptions & OptionalOption & QueryOptions
) => {
const apiUrl = process.env.NEOS_BASE_URL;
Expand Down Expand Up @@ -184,7 +184,7 @@ export const loadQueryResult = async <M, D>(
return undefined;
}

const data: QueryResult<M, D> = await parseResponse(fetchUrl, response);
const data: QueryResult<D, M> = await parseResponse(fetchUrl, response);
const endTime = Date.now();
log.debug('fetched data from content API for query', queryName, ', took', `${endTime - startTime}ms`);

Expand Down

0 comments on commit 88a6711

Please sign in to comment.