Skip to content

Commit 314dab5

Browse files
committed
fix: pagination conventions
1 parent 85932bb commit 314dab5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

starters/express-apollo-prisma/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ indent_size = 2
1515
max_line_length = off
1616
trim_trailing_whitespace = false
1717

18-
[{package.json.eslintrc.json}]
18+
[{package.json, eslintrc.json}]
1919
indent_style = space

starters/express-apollo-prisma/src/graphql/data-sources/technology-data-source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type TechnologyEntityId = TechnologyEntity['id'];
55

66
export type TechnologyEntityCollectionPage = {
77
totalCount: number;
8-
items: TechnologyEntity[];
8+
edges: TechnologyEntity[];
99
};
1010

1111
export class TechnologyDataSource {
@@ -31,7 +31,7 @@ export class TechnologyDataSource {
3131
}
3232

3333
async getTechnologies(limit: number, offset: number): Promise<TechnologyEntityCollectionPage> {
34-
const [totalCount, items] = await this.prismaClient.$transaction([
34+
const [totalCount, edges] = await this.prismaClient.$transaction([
3535
this.prismaClient.technologyEntity.count(),
3636
this.prismaClient.technologyEntity.findMany({
3737
take: limit,
@@ -40,7 +40,7 @@ export class TechnologyDataSource {
4040
]);
4141
return {
4242
totalCount,
43-
items,
43+
edges,
4444
};
4545
}
4646

starters/express-apollo-prisma/src/graphql/schema/technology/technology.typedefs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ export const technologyTypeDefs = gql`
1818
"""
1919
A page of technology items
2020
"""
21-
type Collection {
21+
type TechnologyCollection {
2222
"Identifies the total count of technology records in data source"
2323
totalCount: Int!
2424
"A list of records of the requested page"
25-
items: [Technology]!
25+
edges: [Technology]!
2626
}
2727
2828
"""
@@ -32,7 +32,7 @@ export const technologyTypeDefs = gql`
3232
"Returns a single Technology by ID"
3333
technology(id: ID!): Technology
3434
"Returns a list of Technologies"
35-
technologies(limit: Int = 5, offset: Int = 0): Collection!
35+
technologies(limit: Int = 5, offset: Int = 0): TechnologyCollection!
3636
}
3737
3838
input CreateTechnology {

0 commit comments

Comments
 (0)