This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
units: { | |
type: pagination.Page(Unit), | |
description: "Return the 'first' X number of items 'after' the specified cursor'", | |
args: { | |
first: { | |
type: graphql.GraphQLInt, | |
description: "Limits the number of results returned in the page. Defaults to 10." | |
}, | |
after: { | |
type: graphql.GraphQLString, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//recibe un array y una callback asyncrona | |
// y cada promesa se va ejecutando secuencialmente | |
// seria lo contrario a un Promise.all() | |
// me fue util para manejar los insert en la bd con typeorm y evitar conflictos de ids, duplicacion y fallos en las queries | |
export const runPromisesSequentally = async ( | |
arr: any, | |
asyncFn: (item: any) => Promise<any> | |
): Promise<any[]> => { | |
const allContents = []; |
OlderNewer