Skip to content

Commit

Permalink
feature: Cosmetics and ownership state (#11)
Browse files Browse the repository at this point in the history
Adds the ability to query cosmetics and the ownership state of them for players.

Note that the inability to query cosmetics without a player is intentional as not every player has access to every cosmetic. Therefore, cosmetics that players do not have access to should not be counted as cosmetics that exist for them!
  • Loading branch information
kezz authored Dec 11, 2024
1 parent 362295c commit b1608c2
Showing 1 changed file with 101 additions and 1 deletion.
102 changes: 101 additions & 1 deletion schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,29 @@ type Social {
type Collections {
"The player's earned currency."
currency: Currency!

"Returns the ownership state of all cosmetics, optionally in a category and/or collection."
cosmetics(
category: CosmeticCategory = null,
collection: String = null
@spectaql(options: { key: "example", value: "Oceanic" })
): [CosmeticOwnershipState!]!
}

"The ownership state of a cosmetic."
type CosmeticOwnershipState {
"The cosmetic in question."
cosmetic: Cosmetic!

"If the cosmetic is owned."
owned: Boolean!

"The Chroma Packs that have applied to this cosmetic, if it is colorable."
chromaPacks: [String!]
@spectaql(options: { key: "example", value: "[\"oceanic\", \"natural\"" })

"The number of Royal Reputation donations that have been made of this cosmetic, if it can be donated."
donationsMade: Int
}

"A player's earned currency."
Expand All @@ -160,7 +183,7 @@ type Currency {

"The number of material dust the player currently has."
materialDust: Int!

"The number of A.N.G.L.R. Tokens the player currently has."
anglrTokens: Int!
}
Expand Down Expand Up @@ -343,6 +366,83 @@ enum Rotation {
LIFETIME
}

"Different categories of cosmetics."
enum CosmeticCategory {
"Hats."
HAT

"Accessories."
ACCESSORY

"Auras."
AURA

"Trails."
TRAIL

"Cloaks."
CLOAK

"Fishing rods."
ROD
}

"Different tiers of rarity."
enum Rarity {
"Common."
COMMON

"Uncommon."
UNCOMMON

"Rare."
RARE

"Epic."
EPIC

"Legendary."
LEGENDARY

"Mythic."
MYTHIC
}

"A cosmetic."
type Cosmetic {
"The name of the cosmetic."
name: String!

"The category the cosmetic is in."
category: CosmeticCategory!

"The collection this cosmetic is in."
collection: String!

"The rarity of the cosmetic."
rarity: Rarity!

"If this cosmetic can be colored using Chroma Packs."
colorable: Boolean!

"""
The number of trophies this cosmetic awards.
Note that this does not include the completion bonus for applying all Chroma Packs to the cosmetic.
"""
trophies: Int!

"""
If this cosmetic awards bonus trophies.
This will be `null` if the cosmetic does not award any trophies.
"""
isBonusTrophies: Boolean

"If this cosmetic can be donated for Royal Reputation."
canBeDonated: Boolean!
}

"Available queries."
type Query {
"Given a UUID, returns a Player if they have logged in to MCC Island."
Expand Down

0 comments on commit b1608c2

Please sign in to comment.