Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate metadata image fetching from metadata query #259

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

bitbeckers
Copy link
Collaborator

@bitbeckers bitbeckers commented Feb 11, 2025

Refactors the SupabaseCachingService to get all metadata columns except for the image. Renamed the getMetadata method to getMetadataWithoutImage to make this explicit.

Introduces MetadataImageService for fetching the image when the field is selected in a metadata query.

Query with image performance on first load:

Screenshot 2025-02-11 at 11 36 49

{
  metadata(first: 10) {
    count
    data {
      allow_list_uri
      contributors
      description
      external_url
      id
      impact_scope
      impact_timeframe_from
      impact_timeframe_to
      name
      properties
      rights
      uri
      work_scope
      work_timeframe_from
      work_timeframe_to
      image
    }
  }
}

Query without image performance on first load:

Screenshot 2025-02-11 at 11 36 32

{
  metadata(first: 10) {
    count
    data {
      allow_list_uri
      contributors
      description
      external_url
      id
      impact_scope
      impact_timeframe_from
      impact_timeframe_to
      name
      properties
      rights
      uri
      work_scope
      work_timeframe_from
      work_timeframe_to
      image
    }
  }
}

Closes #256

Jipperism and others added 4 commits January 30, 2025 14:31
fix: improve error handling in hypercert orders resolver
Refactors the SupabaseCachingService to get all hypercert columns except
for the image. Renamed the getMetadata method to getMetadataWithoutImage
to make this explicit.

Introduces MetadataImageService for fetching the image when the field is
selected in a metadata query.
@bitbeckers bitbeckers added the enhancement New feature or request label Feb 11, 2025
@bitbeckers bitbeckers self-assigned this Feb 11, 2025
Copy link

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 24.24% (🎯 24%) 1049 / 4327
🟢 Statements 24.24% (🎯 24%) 1049 / 4327
🟢 Functions 59.78% (🎯 59%) 55 / 92
🟢 Branches 72.13% (🎯 72%) 176 / 244
File CoverageNo changed files found.
Generated in workflow #60 for commit 12038fc by the Vitest Coverage Report Action

Copy link
Contributor

@Jipperism Jipperism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@bitbeckers bitbeckers merged commit fd67912 into develop Feb 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

2 participants