https://github.com/codehakase/buycoins-th
https://github.com/codehakase/buycoins-th
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codehakase/buycoins-th
- Owner: codehakase
- Created: 2021-03-28T15:13:45.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-28T15:24:01.000Z (almost 5 years ago)
- Last Synced: 2023-02-26T15:32:41.048Z (almost 3 years ago)
- Language: Go
- Size: 305 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task README
## Running & Building application
**Download dependencies with:**
```shell
$ go mod tidy && go mod vendor
```
**Run application with:**
```shell
$ go run main.go
```
**Build application with:**
```shell
$ go build -o xquestions main.go
```
**Access the GraphiQL interface:**
Open browser to `http://localhost:{PORT}/graphiql`

**Live GraphiQL Playground:**
[Heroku App](https://buycoins-th.herokuapp.com/)
## Running Tests
In the root of the application, run `go test ./...` to run all test suites
## GRAPHQL Definitions
### CalculatePrice Query
**Definitions**
- _type:string_
- _margin:string_
**Query**
```gql
query CalculatePrice {
calculatePrice(type: "buy", margin: 0.2, exchangeRate: 476)
}
```
**Response**
```json
{
"data": {
"calculatePrice": 26467774.368
}
}
```