{"id":25852948,"url":"https://github.com/happylolonly/subquery-learning","last_synced_at":"2025-10-24T13:16:00.577Z","repository":{"id":114986126,"uuid":"433488465","full_name":"happylolonly/subquery-learning","owner":"happylolonly","description":"https://subquery.network","archived":false,"fork":false,"pushed_at":"2022-01-23T20:02:53.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T14:37:24.261Z","etag":null,"topics":["blockchain","polkadot","subquery"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/happylolonly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-30T15:43:19.000Z","updated_at":"2021-11-30T16:10:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d51658d-2e05-400d-9b3f-01df6a929f6f","html_url":"https://github.com/happylolonly/subquery-learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/happylolonly/subquery-learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happylolonly%2Fsubquery-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happylolonly%2Fsubquery-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happylolonly%2Fsubquery-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happylolonly%2Fsubquery-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happylolonly","download_url":"https://codeload.github.com/happylolonly/subquery-learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happylolonly%2Fsubquery-learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270989456,"owners_count":24680748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","polkadot","subquery"],"created_at":"2025-03-01T14:30:31.992Z","updated_at":"2025-10-24T13:15:55.544Z","avatar_url":"https://github.com/happylolonly.png","language":"TypeScript","readme":"# SubQuery - Starter Package\n\n\nThe Starter Package is an example that you can use as a starting point for developing your SubQuery project.\nA SubQuery package defines which data The SubQuery will index from the Substrate blockchain, and how it will store it. \n\n## Preparation\n\n#### Environment\n\n- [Typescript](https://www.typescriptlang.org/) are required to compile project and define types.  \n\n- Both SubQuery CLI and generated Project have dependencies and require [Node](https://nodejs.org/en/).\n     \n\n#### Install the SubQuery CLI\n\nInstall SubQuery CLI globally on your terminal by using NPM:\n\n```\nnpm install -g @subql/cli\n```\n\nRun help to see available commands and usage provide by CLI\n```\nsubql help\n```\n\n## Initialize the starter package\n\nInside the directory in which you want to create the SubQuery project, simply replace `project-name` with your project name and run the command:\n```\nsubql init --starter project-name\n```\nThen you should see a folder with your project name has been created inside the directory, you can use this as the start point of your project. And the files should be identical as in the [Directory Structure](https://doc.subquery.network/directory_structure.html).\n\nLast, under the project directory, run following command to install all the dependency.\n```\nyarn install\n```\n\n\n## Configure your project\n\nIn the starter package, we have provided a simple example of project configuration. You will be mainly working on the following files:\n\n- The Manifest in `project.yaml`\n- The GraphQL Schema in `schema.graphql`\n- The Mapping functions in `src/mappings/` directory\n\nFor more information on how to write the SubQuery, \ncheck out our doc section on [Define the SubQuery](https://doc.subquery.network/define_a_subquery.html) \n\n#### Code generation\n\nIn order to index your SubQuery project, it is mandatory to build your project first.\nRun this command under the project directory.\n\n````\nyarn codegen\n````\n\n## Build the project\n\nIn order to deploy your SubQuery project to our hosted service, it is mandatory to pack your configuration before upload.\nRun pack command from root directory of your project will automatically generate a `your-project-name.tgz` file.\n\n```\nyarn build\n```\n\n## Indexing and Query\n\n#### Run required systems in docker\n\n\nUnder the project directory run following command:\n\n```\ndocker-compose pull \u0026\u0026 docker-compose up\n```\n#### Query the project\n\nOpen your browser and head to `http://localhost:3000`.\n\nFinally, you should see a GraphQL playground is showing in the explorer and the schemas that ready to query.\n\nFor the `subql-starter` project, you can try to query with the following code to get a taste of how it works.\n\n````graphql\n{\n  query{\n    starterEntities(first:10){\n      nodes{\n        field1,\n        field2,\n        field3\n      }\n    }\n  }\n}\n````\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappylolonly%2Fsubquery-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappylolonly%2Fsubquery-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappylolonly%2Fsubquery-learning/lists"}