How to save emoji/icon?

Hello.

How to save icon?
String or bytes?

I have indexed event field - icon

  get icon(): Bytes {
    return this._event.parameters[1].value.toBytes();
  }

save

game.icon = event.params.icon.toString();
game.save();

my icon in GraphQL

"icon": "\n�ZA�́\u0015��B\r3ʫ��\u0012�0t�:�7���NBR�",
1 Like

I save - :slightly_smiling_face:
How to save in GraphQL

"icon": "🙂",
1 Like

Ok =)

How to decode indexed event field? Bytes to string?

  get icon(): Bytes {
    return this._event.parameters[1].value.toBytes();
  }
1 Like

Best would be if you could ask this question in our Discord server, in the #subgraph-development channel.

1 Like