You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, first of all really love the project. I have used the no-code version a few times now and it has been a breeze. Recently, I tried using the rust version since I wanted to have some flexibility with indexing as well as the graphQL schema.
So the issue goes like this, I used to use "The Graph", in that we can create a schema.graphql which lets us add our custom entities that show up in their explorer and can be queried. For example, I have this entity in my schema.graphql
typeProvider@entity {
id: ID! #id same as owner addresscp: Stringlive: Boolean
}
and I have this custom event handler:
// ProviderAdded is the event that the contract fires, so think of this as the custom indexerexportfunctionhandleProviderAdded(event: ProviderAdded): void{constid=event.params.provider.toHex();constprovider=newProvider(id);// <--- calling the entity constructor provider.cp=event.params.cp;// <--- modify the cp stringprovider.live=true;// <--- modify the live booleanprovider.save();// <--- now we just save and this event is indexed in the Provider entity}
Now, since I am new to the rust version I might be asking a silly question, but is there a way to achieve this kind of behavior with rindexer right now? Any help/discussion would be really helpful. Feel free to ask any other particulars that are needed to clarify things.
The text was updated successfully, but these errors were encountered:
hey so at the moment we have not fleshed out the schema generation; the best way to do this at the moment is creating your own create.sql which creates the tables you want and this, in turn would be your graphql interface. You would turn creating tables off https://rindexer.xyz/docs/start-building/yaml-config/storage#disable_create_tables and you then can generate the types and indexer and write the data where you need it to go in the handlers. It is on the backlog to make this a lot easier but at the moment, its a bit more complex
Hey, first of all really love the project. I have used the
no-code
version a few times now and it has been a breeze. Recently, I tried using therust
version since I wanted to have some flexibility with indexing as well as the graphQL schema.So the issue goes like this, I used to use "The Graph", in that we can create a
schema.graphql
which lets us add our custom entities that show up in their explorer and can be queried. For example, I have this entity in myschema.graphql
and I have this custom event handler:
Now, since I am new to the rust version I might be asking a silly question, but is there a way to achieve this kind of behavior with rindexer right now? Any help/discussion would be really helpful. Feel free to ask any other particulars that are needed to clarify things.
The text was updated successfully, but these errors were encountered: