{"id":22489675,"url":"https://github.com/dappforce/subsocial-graphql","last_synced_at":"2025-08-02T22:30:54.343Z","repository":{"id":41972720,"uuid":"320631963","full_name":"dappforce/subsocial-graphql","owner":"dappforce","description":"Sample project showcasing Hydra for Subsocial substrate chain","archived":false,"fork":true,"pushed_at":"2022-04-21T09:23:26.000Z","size":1106,"stargazers_count":1,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-03T17:26:31.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dzhelezov/hydra-subsocial-sample","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dappforce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-11T16:51:52.000Z","updated_at":"2022-03-06T21:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dappforce/subsocial-graphql","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dappforce%2Fsubsocial-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dappforce%2Fsubsocial-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dappforce%2Fsubsocial-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dappforce%2Fsubsocial-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dappforce","download_url":"https://codeload.github.com/dappforce/subsocial-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500417,"owners_count":17930062,"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","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":[],"created_at":"2024-12-06T17:20:24.270Z","updated_at":"2024-12-06T17:22:51.586Z","avatar_url":"https://github.com/dappforce.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Sample Hydra Project\n\nThis is a sample project generated by `hydra-cli scaffold`. Experiment by modifying `schema.graphql` and the mappings in the `mappings` folder.\n\n## Prerequisites\n\n* Node v14x\n* Docker\n\n## Bootstrap\n\n```bash\n# The dependencies setup relies on de-duplication, use `ci` to get everything right\nnpm ci\n\n# Start a postgres instance\ndocker-compose up db # add optional -d flag to detach from terminal\n\n# Apply migrations related to the processor's state keeping tables\nnpm run processor:migrate\n\n# Apply the project's migrations\nnpm run db:migrate\n\n# Now you can start processing chain data\nnpm run processor:start\n\n# The above command will block\n# Open a separate terminal and launch the graphql server to query the processed data\nnpm run query-node:start\n```\n\n## Project structure\n\nHydra tools expect a certain directory layout:\n\n* `src/generated` - model/server definitions created by `codegen`. Do not alter the contents of this directory manually.\n* `src/server-extension` - module with custom `type-graphql` based resolvers\n* `src/types` - data type definitions for chain events and extrinsics created by `typegen`.\n* `src/mappings` - mapping module.\n* `lib` - compiled js files. The structure of this directory must reflect `src`.\n* `.env` - hydra tools are heavily driven by environment variables defined here or supplied by a shell.\n\nIf you do not plan to extend GraphQl server you can delete `server-extension` module and then remove \n`type-graphql` and `class-validator` dependencies.\n\n## Development flow\n\nIf you modified `schema.graphql`:\n\n```bash\n# Run codegen to re-generate model/server files\nnpm run codegen\n\n# Analyze database state and create a new migration to match generated models\nnpm run db:create-migration # add -n \"myName\" to skip the migration name prompt\n\n# Apply the migrations\nnpm run db:migrate\n```\n\nYou might want update the `Initial` migration instead of creating a new one (e.g. during the development phase when the production database is not yet set up). In that case it convenient to reset the database schema and start afresh:\n\n```bash\nrm db/migrations/LastUnappliedMigration.ts\nnpm run db:reset\nnpm run db:create-migration\nnpm run db:migrate\n```\n\nTo generate new type definitions for chain events and extrinsics:\n\n```bash\n# Review typegen section of manifest.yml (https://docs.subsquid.io/hydra-typegen)\n\n# Delete old definitions\nrm -rf src/types\n\n# Run typegen tool\nnpm run typegen\n```\n\n## Self-hosted indexer\n\nIt is recommended to use a readily set up indexer if available. It takes some time for a freshly started indexer\nto get in sync with chain and catch the events.\n\nHave a look at `./indexer/docker-compose.yml` for an example of how you can set up a self-hosted version.\n\n## Misc\n\nFor more details, please check out https://docs.subsquid.io.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdappforce%2Fsubsocial-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdappforce%2Fsubsocial-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdappforce%2Fsubsocial-graphql/lists"}