Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: emotes #41

Merged
merged 6 commits into from
Mar 21, 2022
Merged

feat: emotes #41

merged 6 commits into from
Mar 21, 2022

Conversation

cazala
Copy link
Contributor

@cazala cazala commented Mar 11, 2022

Added an Emote entity, and the corresponding new type of metadata

@cazala cazala requested a review from nachomazzara March 11, 2022 21:04
## Emote search fields
searchEmoteCategory: WearableCategory
searchEmoteRarity: String # We're using String instead of WearableRarity here so we can later query this field via ()_in
searchEmoteBodyShapes: [WearableBodyShape!]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchEmoteRarity and searchEmoteBodyShapes may be combined into a single searchRarity and searchBodyShapes and then get rid of the current searchWearableRarity and searchWearableBodyShapes. The thing is if we wanted to change those it would be a breaking change, so we would need to still support the old ones until migration the nft-server and potentially breaking other integrations. Also, even tho those things are repeated between wearables and emotes, they might not exist on other future type of assets (like 3D assets for the Builder) so it might be OK to let them exist only on the item types that actually use them./

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to create an issue with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 #42

name: String!
description: String!
collection: String!
category: EmoteCategory!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between the Wearable and Emote entities is the latter uses EmoteCategory instead of WearableCategory

let wearable = buildWearableItem(item)
if (wearable != null && type == itemTypes.WEARABLE_TYPE_SHORT) {
if (type == itemTypes.WEARABLE_TYPE_SHORT) {
let wearable = buildWearableItem(item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if the wearable is null it will throw at line 28, 30, and for the emote at line 34, right?

Copy link
Contributor Author

@cazala cazala Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i just added some checks to avoid the indexer throwing in case the metadata is malformed (1174c3f)

Copy link
Contributor

@nachomazzara nachomazzara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!! Thanks @cazala

Do not forget to send a commit with the readme updated with the subgraph hashes 🙏

@cazala cazala merged commit cfe7c40 into master Mar 21, 2022
@cazala cazala deleted the feat/emotes branch March 21, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants