Skip to content

Commit

Permalink
Fix graphql not working with the guilds endpoint (slothpixel#702)
Browse files Browse the repository at this point in the history
* feat(Guild): add guild_master data

* fix: add missing property guild
  • Loading branch information
ImRodry authored and ChristianDobbie committed Jan 10, 2022
1 parent 031a596 commit d5aa338
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 5 deletions.
1 change: 1 addition & 0 deletions processors/processGuildData.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function processGuildData({
level: getLevel(exp),
exp_by_game: expByGame,
exp_history: expHistory,
guild_master: processedMembers.find((m) => m.rank === 'Guild Master'),
description,
preferred_games: getPreferredGames(preferredGames),
ranks: insertDefaultRanks(ranks, created).sort((a, b) => b.priority - a.priority),
Expand Down
10 changes: 10 additions & 0 deletions routes/spec.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,11 @@ type Games {
}

type Guild {
"""
Value indicating the success, or not, of the operation. Can be either true or null
"""
guild: Boolean

"""
Guild creation date
"""
Expand All @@ -1612,6 +1617,11 @@ type Guild {
"""
description: String

"""
Member object of the guild master
"""
guild_master: MembersListItem

"""
Total guild xp
"""
Expand Down
112 changes: 107 additions & 5 deletions routes/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ The Slothpixel API provides Hypixel related data.
Currently the API has a rate limit of **60 requests/minute** and **50,000 requests per month**. If you have higher data needs contact the admins on discord.
Consider supporting The Slothpixel Project on Patreon to help cover the hosting costs.
[Discord](https://discord.gg/ND9bJKK) | [Patreon](https://patreon.com/slothpixel)
[Discord](https://discord.gg/ND9bJKK) | [Patreon](https://patreon.com/slothpixel)
# GraphQL
Slothpixel API supports the use of GraphQL query language, and it is recommended for advanced users. [Read more](https://github.com/slothpixel/core/wiki/GraphQL)
`,
Expand All @@ -263,9 +263,9 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
type: 'apiKey',
name: 'key',
description: `Use an API key to remove monthly call limits and to receive higher rate limits.
Usage example: https://api.slothpixel.me/api/players/slothpixel?key=YOUR-API-KEY
API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY"
`,
in: 'query',
Expand Down Expand Up @@ -746,6 +746,10 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
schema: {
type: 'object',
properties: {
guild: {
description: 'Value indicating the success, or not, of the operation. Can be either true or null',
type: 'boolean',
},
name: {
description: 'Guild\'s name',
type: 'string',
Expand Down Expand Up @@ -794,6 +798,36 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
description: 'Guild description',
type: 'string',
},
guild_master: {
description: 'Member object of the guild master',
type: 'object',
properties: {
uuid: {
description: 'Player UUID',
type: 'string',
},
rank: {
description: 'Player rank in the guild',
type: 'string',
},
joined: {
description: 'Member join date',
type: 'integer',
},
quest_participation: {
description: 'How many much the member has contributed to guild quests',
type: 'integer',
},
exp_history: {
description: 'Contains raw guild xp earned in the past week. Uses format YYYY-MM-DD.',
type: 'object',
},
muted_till: {
description: 'Date the member is muted until',
type: 'integer',
},
},
},
preferred_games: {
description: 'Array containing the guild\'s preferred games',
type: 'array',
Expand Down Expand Up @@ -908,6 +942,10 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
schema: {
type: 'object',
properties: {
guild: {
description: 'Value indicating the success, or not, of the operation. Can be either true or null',
type: 'boolean',
},
name: {
description: 'Guild\'s name',
type: 'string',
Expand Down Expand Up @@ -956,6 +994,36 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
description: 'Guild description',
type: 'string',
},
guild_master: {
description: 'Member object of the guild master',
type: 'object',
properties: {
uuid: {
description: 'Player UUID',
type: 'string',
},
rank: {
description: 'Player rank in the guild',
type: 'string',
},
joined: {
description: 'Member join date',
type: 'integer',
},
quest_participation: {
description: 'How many much the member has contributed to guild quests',
type: 'integer',
},
exp_history: {
description: 'Contains raw guild xp earned in the past week. Uses format YYYY-MM-DD.',
type: 'object',
},
muted_till: {
description: 'Date the member is muted until',
type: 'integer',
},
},
},
preferred_games: {
description: 'Array containing the guild\'s preferred games',
type: 'array',
Expand Down Expand Up @@ -1064,6 +1132,10 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
schema: {
type: 'object',
properties: {
guild: {
description: 'Value indicating the success, or not, of the operation. Can be either true or null',
type: 'boolean',
},
name: {
description: 'Guild\'s name',
type: 'string',
Expand Down Expand Up @@ -1112,6 +1184,36 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting
description: 'Guild description',
type: 'string',
},
guild_master: {
description: 'Member object of the guild master',
type: 'object',
properties: {
uuid: {
description: 'Player UUID',
type: 'string',
},
rank: {
description: 'Player rank in the guild',
type: 'string',
},
joined: {
description: 'Member join date',
type: 'integer',
},
quest_participation: {
description: 'How many much the member has contributed to guild quests',
type: 'integer',
},
exp_history: {
description: 'Contains raw guild xp earned in the past week. Uses format YYYY-MM-DD.',
type: 'object',
},
muted_till: {
description: 'Date the member is muted until',
type: 'integer',
},
},
},
preferred_games: {
description: 'Array containing the guild\'s preferred games',
type: 'array',
Expand Down

0 comments on commit d5aa338

Please sign in to comment.