This is a CRUD GRAPHQL API implemented in TypeScript & PostgresQL using TypeOrm
npm install
npm run dev
npm run build && npm start
- Movie
- Get all movies
- Get one movie
- Add a movie
- Update a movie
- Delete a movie
scalar DateTime
type Movie {
actors: [String!]!
createdAt: DateTime!
description: String!
id: Float!
releaseYear: String!
title: String!
updatedAt: DateTime!
}
type Mutation {
addMovie(MovieInput: CreateMovieInput!): Movie!
deleteMovie(id: Float!): Boolean!
updateMovie(MovieInput: UpdateMovieInput!, id: Float!): Movie!
}
type Query {
getMovie(id: Float!): Movie
getMovies: [Movie!]
}
input UpdateMovieInput {
actors: [String!]
description: String
releaseYear: String
title: String
}
input CreateMovieInput {
actors: [String!]!
description: String!
releaseYear: String
title: String!
}
graph-ts-api
├─ src
│ ├─ database
│ │ ├─ entity
│ │ │ └─ Movie.ts
│ │ ├─ index.ts
│ │ ├─ migrations
│ │ │ └─ 1615219775175-MovieTable.ts
│ │ └─ services
│ │ └─ movieService.ts
│ ├─ index.ts
│ ├─ resolvers
│ │ └─ movie.ts
│ └─ schema
│ └─ movie.ts
└─ tsconfig.json
├─ .eslintignore
├─ .eslintrc.json
├─ .gitignore
├─ .prettierignore
├─ .prettierrc
├─ ormconfig.ts
├─ package.json
├─ README.md
├─ schema.gql