https://github.com/4lessandrodev/cascade-sql-example
testing SQL in cascade
https://github.com/4lessandrodev/cascade-sql-example
Last synced: 10 months ago
JSON representation
testing SQL in cascade
- Host: GitHub
- URL: https://github.com/4lessandrodev/cascade-sql-example
- Owner: 4lessandrodev
- Created: 2021-11-25T05:41:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-25T05:46:47.000Z (about 4 years ago)
- Last Synced: 2025-01-07T14:24:59.741Z (12 months ago)
- Language: TypeScript
- Size: 374 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple example how to use typeorm (SQL) with domain
## How to run this application
Clone this repo
`$ git clone `
Install dependencies
`$ yarn install`
Up database docker service
`$ docker-compose up -d`
Run application
`$ yarn start:dev`
Open playground
`$ http://localhost:3000/graphql`
Queries and Mutations
```gql
mutation CreateService {
createService(CreateServiceInput:{
name: "hello name"
})
}
query GetServices {
getService{
id
name
createdAt
updatedAt
}
}
mutation CreateAccount {
createAccount(CreateAccountInput:{
name:"new account",
servicesId: [
"6f0f8924-ae4c-4549-ad83-745c37ce6211",
"94817251-b65f-4d97-8f17-6594a0c27324"
]
})
}
query GetAccounts {
getAccount{
id
name
createdAt
updatedAt
services{
id
name
}
}
}
mutation UpdateAccount {
updateAccount(UpdateAccountInput:{
id:"518bfe8a-c85b-4f37-88e2-8453dde09437"
name:"one neew value name"
servicesId:[
"d2123de9-0394-4525-ba47-1ae38d6b65f8"
]
})
}
```