dipdup-io / dipdup

Modular framework for creating selective indexers and featureful backends for dapps
https://dipdup.io
MIT License
92 stars 52 forks source link

hasura 2.0.3 and dipdup 2.0.6 don't work #120

Closed bb4L closed 3 years ago

bb4L commented 3 years ago

dipdup is trying to query public_dipdup_state

as far as i could investingate the correct query might be dipdup_state, if i'm not mistaking...

File "/usr/local/lib/python3.9/site-packages/dipdup/hasura.py", line 309, in _get_fields raise HasuraError(f'Unknown table `{name}`') from edipdup.hasura.HasuraError: Unknown table `public_dipdup_state`

relevant line(s) of code:

https://github.com/dipdup-net/dipdup-py/blob/7cf40a825db6b6fbcd3211a7b2414b9e683ae1b7/src/dipdup/hasura.py#L281

( using hasura 1.3.3 with dipdup 2.0.5 works )

droserasprout commented 3 years ago

Hasura error when schema_name is undefined

droserasprout commented 3 years ago

@bb4L, @sbihel, fixed in 2.0.7, Docker images will be available soon.

A small feature (probably no one knew about it except me) was removed in this release. Before today, DipDup tried to merge existing Hasura metadata: tables, queries and REST endpoints. This allowed to use a single Hasura deployment with multiple DipDup instances. Could save some time developing multiple backends at once. However, the following problems revealed:

So I decided to remove corresponding code and reset Hasura metadata on every configuration. Please reply in this thread or Baking Bad chats if you'd like to have an ability to inject arbitrary metadata (in addition to queries from project/graphql directory) on Hasura configuration.

bb4L commented 3 years ago

@droserasprout i updated to dipdup 2.0.7 and hasura 2.0.3 now i get: Unknown table `hat` ( same for dipdup 2.0.7 and hasura 2.0.6)

am i missing something? / some configurations?

EDIT: not sure if related but if i'm not mistaking i just had the issue when restarting from "scratch" with dipdup 2.0.5 and hasura 1.3.3 it doesn't automatically expose the tables on hasura

droserasprout commented 3 years ago

@bb4L, please post here or PM me code of models.py module of your project, so I can reproduce this issue.

droserasprout commented 3 years ago

Fixed in 2.0.8.