Skip to content

[GraphiQL] 5.2.0 – Image preview not loaded correctly #4101

@nastoychev

Description

@nastoychev

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Image

After migrating from version 3 to 5, we are experiencing a problem where the playground attempts to fetch images via a relative path instead of fetching them directly from the provided URL.

Expected Behavior

If the link starts with http/https, fetch the image directly from the provided URL.
If not, continue with the current behavior of fetching the image from the absolute path.

Steps To Reproduce

No response

Environment

  • GraphiQL Version: 5.2.0
  • OS: Windows 11
  • Browser: Edge latest version
  • Bundler: Vite
  • react Version: -
  • graphql Version: -

Anything else?

In my case, pathToUrl() isn’t necessary since I already have a full http(s) URL.

graphiql/packages/graphiql-react/src/components/image-preview.tsx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions