Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Update docs (#69)
Browse files Browse the repository at this point in the history
* Update readme and example queries

* Update FORMATTED_SCHEMA.md
  • Loading branch information
mithi committed Oct 29, 2020
1 parent b672f57 commit 99b20c5
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 76 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -2,8 +2,8 @@

- Simply get Kingdom Rush Tower information through queries in GraphQL
- first-timers welcome! Here's a [step-by-step](./docs/GOOD_FIRST_ISSUE.md) instruction to making your first pull request
- [gql schema](./schema.gql)
- [Schema formatted](./docs/FORMATTED_SCHEMA.gql) manually by yours truly
- [gql schema](./schema.gql) generated by TypegraphQL
- [Schema formatted](./docs/FORMATTED_SCHEMA.md) manually by yours truly
- [Sample queries](./docs/EXAMPLE_QUERIES.md)

## Tools
Expand Down
119 changes: 66 additions & 53 deletions docs/EXAMPLE_QUERIES.md
@@ -1,3 +1,69 @@
# Towers

```graphql
{
towers(
onlyLevels: [LVL4]
sortDefinition: [{ column: damageMaximum, sortOrder: DESCEND }]
) {
name
kingdom
damageMaximum
}
}
```

```graphql
{
barracksTowers(
sortDefinition: [
{ column: kingdom, sortOrder: ASCEND }
{ column: name, sortOrder: ASCEND }
]
) {
name
kingdom
}
}
```

```graphql
{
attackTowers(
take: 10
sortDefinition: [
{ column: towerType, sortOrder: ASCEND }
{ column: name, sortOrder: DESCEND }
]
onlyKingdoms: [KR, KRF]
) {
towerType
name
}
}
```

```graphql
{
towerById(id: 10) {
allStats {
name
fireInterval
numberOfUnits
}
abilities {
abilityName
abilityDescription
levelCosts
}
buildSequence {
totalBuildCost
totalBuildCostFullyUpgraded
}
}
}
```

# Abilities

```graphql
Expand Down Expand Up @@ -153,56 +219,3 @@
}
}
```

# Towers

```graphql
{
barracksTowers(
sortDefinition: [
{ column: kingdom, sortOrder: ASCEND }
{ column: name, sortOrder: ASCEND }
]
) {
name
kingdom
}
}
```

```graphql
{
attackTowers(
take: 10
sortDefinition: [
{ column: towerType, sortOrder: ASCEND }
{ column: name, sortOrder: DESCEND }
]
onlyKingdoms: [KR, KRF]
) {
towerType
name
}
}
```

```graphql
{
towerById(id: 10) {
allStats {
name
fireInterval
numberOfUnits
}
abilities {
abilityName
abilityDescription
levelCosts
}
buildSequence {
totalBuildCost
totalBuildCostFullyUpgraded
}
}
}
```
42 changes: 21 additions & 21 deletions docs/FORMATTED_SCHEMA.md
Expand Up @@ -18,6 +18,27 @@ type Query {
take: Int = 104
): [Ability!]!

buildSequences(
onlyKingdoms: [TowerKingdom!] = [KR, KRF, KRO, KRV]
onlyTowerTypes: [TowerType!] = [BARRACKS, ARCHER, ARTILLERY, MAGE]
skip: Int = 0
sortDefinition: [BuildSequenceSortDefinitionElement!] = [
{ column: kingdom, sortOrder: ASCEND }
{ column: towerType, sortOrder: ASCEND }
{ column: towerName, sortOrder: ASCEND }
]
take: Int = 104
): [BuildSequence!]!

towers(
onlyKingdoms: [TowerKingdom!] = [KR, KRF, KRO, KRV]
onlyLevels: [TowerLevel!] = [LVL1, LVL2, LVL3, LVL4]
onlyTowerTypes: [TowerType!] = [BARRACKS, ARCHER, ARTILLERY, MAGE]
skip: Int = 0
sortDefinition: [SortDefinitionElement!] = [{ column: id, sortOrder: ASCEND }]
take: Int = 104
): [TowerWithStats!]!

attackTowers(
onlyKingdoms: [TowerKingdom!] = [KR, KRF, KRO, KRV]
onlyLevels: [TowerLevel!] = [LVL1, LVL2, LVL3, LVL4]
Expand All @@ -39,27 +60,6 @@ type Query {
take: Int = 104
): [BarracksTower!]!

buildSequences(
onlyKingdoms: [TowerKingdom!] = [KR, KRF, KRO, KRV]
onlyTowerTypes: [TowerType!] = [BARRACKS, ARCHER, ARTILLERY, MAGE]
skip: Int = 0
sortDefinition: [BuildSequenceSortDefinitionElement!] = [
{ column: kingdom, sortOrder: ASCEND }
{ column: towerType, sortOrder: ASCEND }
{ column: towerName, sortOrder: ASCEND }
]
take: Int = 104
): [BuildSequence!]!

towers(
onlyKingdoms: [TowerKingdom!] = [KR, KRF, KRO, KRV]
onlyLevels: [TowerLevel!] = [LVL1, LVL2, LVL3, LVL4]
onlyTowerTypes: [TowerType!] = [BARRACKS, ARCHER, ARTILLERY, MAGE]
skip: Int = 0
sortDefinition: [SortDefinitionElement!] = [{ column: id, sortOrder: ASCEND }]
take: Int = 104
): [TowerWithStats!]!

abilitiesByTowerId(id: Float!): [Ability!]!
abilitiesByTowerName(name: String!): [Ability!]!
abilityById(id: Float!): Ability
Expand Down

0 comments on commit 99b20c5

Please sign in to comment.