ID Types
There are a few important things related to the use of IDs.
Every GraphQL type defined in your schema file is required to have an id field.
- This field must be called
id
- The type of this
id
field must by au64
- You typically want to use the
ID
type for theseid
fieldsWhy must every field have an ID?
Since the Fuel Indexer uses WASM runtimes to index events, an FFI is needed to call in and out of the runtime. When these calls out of the runtime are made, a pointer is passed back to the indexer service to indicate where the
id
of the type/object/entity being saved is.Is this liable to change in the future?
Yes, ideally we'd like ID's to be of any type, and we plan to work towards this in the future. 👍