dipdup-io/dipdup

Option to hide internal tables in Hasura

Closed this issue · 3 comments

Configure Hasura to exclude internal tables from generating a GraphQL API based on a specific naming pattern.
Indexer config should have an option to skip dipdup_* tables. And maybe arbitrary ones. Like this:

hasura:
  url: ...
  ignore_internal: true
  ignore:
    - some_user_table

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a backend developer with years of experience skilled in python, solidity and cairo.

How I plan on tackling this issue

I'd find the hasura configuration file and include an sql function to exclude specific functions. ETA 2 days

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a fullstack and smart contract developer. I've contributed to Projects here on onlydust
and with that experience, I would handle this task as expected. This would also be my first time
contributing to this project.

How I plan on tackling this issue

  1. Set Up Hasura Metadata Config: In the Hasura configuration, I will specify which tables to expose in the GraphQL schema. Use the ignore option to exclude specific tables and ignore_internal to skip internal tables like dipdup_*.

  2. Update Metadata API: Hasura offers a metadata API that allowsto update the visibility of tables based on their names or patterns (like dipdup_*).

  3. Ignore Tables Based on a Pattern: Since I want to exclude tables that follow a certain pattern (e.g., dipdup_*), I'll need to add a script that fetches the metadata for all tables and updates it to ignore any tables that match the naming pattern.

  4. YAML Configuration Example: I will manually list specific tables to ignore or set an internal flag.

  5. Script to Automate Exclusion: Write a script that calls Hasura’s metadata API and excludes tables based on the defined patterns (e.g., tables that start with dipdup_). This script will be integrated into the build or deployment process to automate the exclusion.

  6. Call Hasura Metadata API.

  7. Custom Logic for Pattern-Based Skipping: To skip tables with specific patterns like dipdup_, I will have to filter tables in the script to, Fetch all tables via Hasura metadata, Filter out tables matching the dipdup_ pattern, send an update request to Hasura to exclude those tables.

ETA: 48hrs

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a python dev. A new-comer here, willing and ready to contribute to solve this issue.