I was doing a project, and I have an event
event AddedDoctor(
address indexed doctorAddress,
string indexed name,
string indexed doctorRegistrationId,
uint256 dateOfRegistration,
string specialization,
address hospitalAddress
);
I am not able to access all the parameters of this event to index it is The Graph. I am facing two issues :
string indexed nameparameter is indexed so it is accessible byevent.params.namebut it is in theBytesformat. On searching the net I found that indexed strings or arrays are stored as hashes and not plain strings. How do I get unstuck.- I am not able to read unindexed parameters
string specializationandaddress hospitalAddressusingevent.params.specializationandevent.params.hospitalAddress. How do I access these unindexed parameters?
Basically I want to index all these event parameters in The Graph for easy retrieval of data. How can I do that?
I found that
The Graphcan index the unindexed string parameter in the string format and we can directly work with that. Theindexedstring parameters are hashed into into 20 bytes object which is difficult to work with. I found this answer very helpful:https://ethereum.stackexchange.com/questions/6840/indexed-event-with-string-not-getting-logged
So, basically I removed
indexedkeyword from all the parameters ofstringorarraytype and it works.