Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@screeny05
Copy link
Contributor

The hygraph connector now only adds optimizations to the url if they are requested.

πŸ”— Linked issue

Fixes #1998

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This fix modifies the hygraph provider to ensure no broken URLs are being returned from it. Specifically, the hygraph asset transformation API does not accept an empty resize parameter in the URL. Calling the provider without a transform will build a URL like this:

https://eu-west-2.graphassets.com/<baseId>/resize=/auto_image/<imageId>

That is wrong, as hygraph expects the resize= parameter to have at least width or height values. Otherwise it will throw a Bad Request error response.

This PR only adds the parameter, when there's a transformation going on.

The hygraph connector now only adds optimizations to the url if they are requested
@screeny05 screeny05 requested a review from danielroe as a code owner October 30, 2025 16:16
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 30, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1999

commit: 16c125b

@screeny05
Copy link
Contributor Author

Just fixed the failing test

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
βœ… Project coverage is 7.03%. Comparing base (b4b8b0e) to head (16c125b).

Files with missing lines Patch % Lines
src/runtime/providers/hygraph.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1999      +/-   ##
========================================
- Coverage   7.03%   7.03%   -0.01%     
========================================
  Files         77      77              
  Lines       3567    3570       +3     
  Branches     138     138              
========================================
  Hits         251     251              
- Misses      3268    3271       +3     
  Partials      48      48              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielroe danielroe merged commit e6a0e82 into nuxt:main Oct 30, 2025
7 checks passed
This was referenced Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hygraph provider produces broken URLs when no transformation is requested

3 participants