diff --git a/starters/express-apollo-prisma/.editorconfig b/starters/express-apollo-prisma/.editorconfig index 0bc6b5fd0..5a39c9945 100644 --- a/starters/express-apollo-prisma/.editorconfig +++ b/starters/express-apollo-prisma/.editorconfig @@ -15,5 +15,5 @@ indent_size = 2 max_line_length = off trim_trailing_whitespace = false -[{package.json.eslintrc.json}] +[{package.json, eslintrc.json}] indent_style = space \ No newline at end of file diff --git a/starters/express-apollo-prisma/src/graphql/data-sources/technology-data-source.ts b/starters/express-apollo-prisma/src/graphql/data-sources/technology-data-source.ts index 714084b65..2a8b8ac74 100644 --- a/starters/express-apollo-prisma/src/graphql/data-sources/technology-data-source.ts +++ b/starters/express-apollo-prisma/src/graphql/data-sources/technology-data-source.ts @@ -5,7 +5,7 @@ type TechnologyEntityId = TechnologyEntity['id']; export type TechnologyEntityCollectionPage = { totalCount: number; - items: TechnologyEntity[]; + edges: TechnologyEntity[]; }; export class TechnologyDataSource { @@ -31,7 +31,7 @@ export class TechnologyDataSource { } async getTechnologies(limit: number, offset: number): Promise { - const [totalCount, items] = await this.prismaClient.$transaction([ + const [totalCount, edges] = await this.prismaClient.$transaction([ this.prismaClient.technologyEntity.count(), this.prismaClient.technologyEntity.findMany({ take: limit, @@ -40,7 +40,7 @@ export class TechnologyDataSource { ]); return { totalCount, - items, + edges, }; } diff --git a/starters/express-apollo-prisma/src/graphql/schema/technology/technology.typedefs.ts b/starters/express-apollo-prisma/src/graphql/schema/technology/technology.typedefs.ts index 8f51a49fc..6c7bbd63a 100644 --- a/starters/express-apollo-prisma/src/graphql/schema/technology/technology.typedefs.ts +++ b/starters/express-apollo-prisma/src/graphql/schema/technology/technology.typedefs.ts @@ -18,11 +18,11 @@ export const technologyTypeDefs = gql` """ A page of technology items """ - type Collection { + type TechnologyCollection { "Identifies the total count of technology records in data source" totalCount: Int! "A list of records of the requested page" - items: [Technology]! + edges: [Technology]! } """ @@ -32,7 +32,7 @@ export const technologyTypeDefs = gql` "Returns a single Technology by ID" technology(id: ID!): Technology "Returns a list of Technologies" - technologies(limit: Int = 5, offset: Int = 0): Collection! + technologies(limit: Int = 5, offset: Int = 0): TechnologyCollection! } input CreateTechnology {