From f9040b72a831f424fdf98968cf41ecda65f77dbb Mon Sep 17 00:00:00 2001 From: gianalarcon Date: Wed, 6 Dec 2023 18:27:22 -0500 Subject: [PATCH] remove model_names, update ECS 15 content --- src/cairo/hello-dojo.md | 13 +++++-------- src/toolchain/torii/graphql.md | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/cairo/hello-dojo.md b/src/cairo/hello-dojo.md index 1907c651..a3eefd32 100644 --- a/src/cairo/hello-dojo.md +++ b/src/cairo/hello-dojo.md @@ -193,8 +193,8 @@ We covered a lot here in a short time. Let's recap: - Explained the anatomy of a Dojo project - Explained the importance of the `#[derive(Model)]`attribute -- Explained the `execute` function -- Explained the `Context` struct +- Explained the `spawn` and `move` functions +- Explained the `Moves` and `Position` struct - Touched on the `get!` and `set!` commands ### Run it locally! @@ -262,16 +262,16 @@ Your 🌎 is now deployed at `0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791 This establishes the world address for your project. -Let's discuss the `Scarb.toml` file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it [here](./config.md)). Make sure your file specifies the version of Dojo you have installed! In this case version `0.3.13`. +Let's discuss the `Scarb.toml` file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it [here](./config.md)). Make sure your file specifies the version of Dojo you have installed! In this case version `0.3.14`. ```toml [dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", version = "0.3.13" } +dojo = { git = "https://github.com/dojoengine/dojo", version = "0.3.14" } ``` ### Indexing -With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your world address from the output of `sozo migrate`. Now Open a new terminal and input this simple command that includes your own world address: +With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your `world address` from the output of `sozo migrate`. Now Open a new terminal and input this simple command that includes your own world address: ```bash torii --world 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138 @@ -337,7 +337,6 @@ subscription { entityUpdated { id keys - model_names event_id created_at updated_at @@ -373,7 +372,6 @@ Now, go back to your GraphiQL IDE, and you will notice that you have received th "keys": [ "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" ], - "model_names": "Moves", "event_id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0000", "created_at": "2023-10-18 06:53:12", "updated_at": "2023-10-18 06:53:12" @@ -388,7 +386,6 @@ Now, go back to your GraphiQL IDE, and you will notice that you have received th "keys": [ "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" ], - "model_names": "Moves,Position", "event_id": "0x000000000000000000000000000000000000000000000000000000000000000b:0x0000:0x0001", "created_at": "2023-10-18 06:53:12", "updated_at": "2023-10-18 06:53:12" diff --git a/src/toolchain/torii/graphql.md b/src/toolchain/torii/graphql.md index 34290711..173297be 100644 --- a/src/toolchain/torii/graphql.md +++ b/src/toolchain/torii/graphql.md @@ -117,6 +117,7 @@ query{ } } ``` + If you execute this query after you applied `sozo migrate` in your [`hello-dojo`](../../cairo/hello-dojo.md) example. You will get an output similar to this. ```json @@ -293,7 +294,6 @@ subscription { ) { id keys - model_names event_id created_at updated_at @@ -324,7 +324,6 @@ According to your input, you will receive an output like this: "keys": [ "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" ], - "model_names": "Moves,Position", "event_id": "0x0000000000000000000000000000000000000000000000000000000000000013:0x0000:0x0000", "created_at": "2023-10-17 11:39:42", "updated_at": "2023-10-17 11:52:48", @@ -352,8 +351,8 @@ According to your input, you will receive an output like this: A valuable approach for harnessing the power of GraphQL is by actively monitoring the events emitted throughout your game. This allows you to extract essential information such as key values, data, and transaction hashes. These events are customizable and can be filtered based on keys, much like `entities query`, and they seamlessly support pagination. In the subsequent example, we will demonstrate how to listen for any event emitted within your program. ```graphql -subscription{ - eventEmitted{ +subscription { + eventEmitted { id keys data @@ -361,6 +360,7 @@ subscription{ } } ``` + If you execute this suscription after you applied `sozo execute spawn` in your [`hello-dojo`](../../cairo/hello-dojo.md) example. You will get an output similar to this. ```json