Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kareem-Medhat committed Nov 19, 2023
1 parent f5e5e8e commit d1bf50b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export async function findManyCursorConnection<
const skip = cursor ? 1 : undefined

// Execute the underlying query operations
const results = await Promise.all([findMany({ cursor, take, skip }), hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1)])
const results = await Promise.all([
findMany({ cursor, take, skip }),
hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1),
])
records = results[0]
totalCount = results[1]

Expand All @@ -65,7 +68,10 @@ export async function findManyCursorConnection<
const skip = cursor ? 1 : undefined

// Execute the underlying query operations
const results = await Promise.all([findMany({ cursor, take, skip }), hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1)])
const results = await Promise.all([
findMany({ cursor, take, skip }),
hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1),
])
records = results[0]
totalCount = results[1]

Expand All @@ -79,10 +85,10 @@ export async function findManyCursorConnection<
if (hasPreviousPage) records.shift()
} else {
// Execute the underlying query operations
const results = await Promise.all([
hasRequestedField('edges') || hasRequestedField('nodes') ? findMany({}) : Promise.resolve([]),
hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1)
])
const results = await Promise.all([
hasRequestedField('edges') || hasRequestedField('nodes') ? findMany({}) : Promise.resolve([]),
hasRequestedField('totalCount') ? aggregate() : Promise.resolve(-1),
])
records = results[0]
totalCount = results[1]

Expand Down

0 comments on commit d1bf50b

Please sign in to comment.