Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basemax/typescript-graphql-crud-example
A example repository to show how you can create your first GraphQL Restful with TS and not JS.
https://github.com/basemax/typescript-graphql-crud-example
graphql graphql-api graphql-client graphql-schema graphql-server javascript js nodejs ts typescript
Last synced: about 1 month ago
JSON representation
A example repository to show how you can create your first GraphQL Restful with TS and not JS.
- Host: GitHub
- URL: https://github.com/basemax/typescript-graphql-crud-example
- Owner: BaseMax
- License: mit
- Created: 2021-06-13T13:08:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T16:35:52.000Z (about 2 months ago)
- Last Synced: 2024-10-11T13:04:17.489Z (about 1 month ago)
- Topics: graphql, graphql-api, graphql-client, graphql-schema, graphql-server, javascript, js, nodejs, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 618 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typescript GraphQL CRUD Example
A example repository to show how you can create your first GraphQL Restful with TS and not JS.
![](demo.png)
## Getting start
```
yarn install
yarn start
```And open `http://localhost:4000/graphql`
## Create another new project
```
npx create-graphql-express my-api
cd my-api
npm install
npm run dev
```Read more: https://github.com/rafaelnsantos/create-graphql-api
## Examples
### Insert/Create
```
mutation {
createMovie(
options: {
title: "bob3", minutes: 10
}) {
id
title
minutes
}
}
```### Update
```
mutation {
updateMovie(id: 30
input: {
title: "New bob"
})
}
```### Select
```
{
movies {
id
title
minutes
}
}
```#### Delete
```
mutation {
deleteMovie(id: 3)
}
```## References
https://www.youtube.com/watch?v=WhzIjYQmWvs
I fixed some minor changes to works with the latest version of `graphql-api`.
© Copyright 2021, Max Base