Pour rappel le message de Manu qui démontait la stack de subsquid:
Et ça me semble pertinent de reposter la réponse qui lui a été fait à ce sujet sur github:
Hey @ManUtopiK
First of all, thanks a lot for choosing Subsquid for indexing your Substrate data and posting this issue. We definitely considered Hasura and GraphiQL before building OpenReader. Keep in mind that Squid API is designed to be lightweight and easily deployable yet expressive, as we progress towards complete decentralization.
Here’s why:
- We wanted a smooth and vertically integrated solution for building the schema, typescript models, migrations and GraphQL API from a single schema file.
- We wanted to have full control of how data is fetched and what GraphQL features we want to support off the shelf. Hasura does not provide a feasible solution to the features we’d like to have. To name a few:
- Custom scalars with full control of marshalling/unmarshalling (e.g. BigInt, Float. Address scalars)
- JSONB queries (Hasura offers very limited filtering support)
- Interfaces and Union types
- Full-text search support
- We wanted to support custom GraphQL resolvers/API extensions while keeping it simple and easily portable
- Unified codebase (Typescript)
- Minimal external dependencies to make decentralisation easier (remember, we’re not just building a centralized bespoke API but a decentralized marketplace for hosting Squid APIs)
Also, we don’t need an ORM with Hasura. Hasura is an ORM on top of database!
Why using typeorm in squid to build the graphql api when Hasura could do that out of the box?I am not sure what you mean here. GraphQL server does not use TypeORM. TypeORM is indeed used under the hood by the Squid Processor, which is an ETL process which runs independently from the presentation layer.
At the same time it’s a totally legit case to use Squid API as a part of a top-level Hasura endpoint or do schema stitching any other way, if it suits you best.
I’m genuinely interested in your use-case and would be happy to discuss more in TG – feel free to ping me
@dzlzv
on Telegram.