Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[express-apollo-prisma] Final cleanup from demo feedback #1207

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions starters/express-apollo-prisma/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ indent_size = 2
[*.md]
max_line_length = off
trim_trailing_whitespace = false

[{package.json, eslintrc.json}]
indent_style = space
kodejuice marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 2 additions & 3 deletions starters/express-apollo-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
"scripts": {
"codegen": "graphql-codegen && npm run format:codegen",
"prepare": "npm run prisma:generate && npm run codegen",
"test": "npm run prepare && jest",
"test": "jest",
"start": "npm run prepare && prisma migrate dev && nodemon",
"dev:test": "jest",
"dev:start": "nodemon",
"dev": "nodemon",
"build": "npm run prepare && tsc --project tsconfig.build.json",
"lint": "eslint \"src/**/*.ts\"",
"lint:fix": "npm run lint --fix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type TechnologyEntityId = TechnologyEntity['id'];

export type TechnologyEntityCollectionPage = {
totalCount: number;
items: TechnologyEntity[];
edges: TechnologyEntity[];
};

export class TechnologyDataSource {
Expand All @@ -31,7 +31,7 @@ export class TechnologyDataSource {
}

async getTechnologies(limit: number, offset: number): Promise<TechnologyEntityCollectionPage> {
const [totalCount, items] = await this.prismaClient.$transaction([
const [totalCount, edges] = await this.prismaClient.$transaction([
this.prismaClient.technologyEntity.count(),
this.prismaClient.technologyEntity.findMany({
take: limit,
Expand All @@ -40,7 +40,7 @@ export class TechnologyDataSource {
]);
return {
totalCount,
items,
edges,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const technologyTypeDefs = gql`
"""
A page of technology items
"""
type TechnologyCollectionPage {
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]!
}

"""
Expand All @@ -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): TechnologyCollectionPage!
technologies(limit: Int = 5, offset: Int = 0): TechnologyCollection!
}

input CreateTechnology {
Expand Down