diff --git a/.changeset/pink-singers-glow.md b/.changeset/pink-singers-glow.md new file mode 100644 index 00000000000..437ed778636 --- /dev/null +++ b/.changeset/pink-singers-glow.md @@ -0,0 +1,6 @@ +--- +"@graphiql/react": minor +"graphiql": minor +--- + +Add webp support to graphiql results image-preview diff --git a/packages/graphiql-react/src/editor/components/image-preview.tsx b/packages/graphiql-react/src/editor/components/image-preview.tsx index b330f7bb01a..4a2b65dfc16 100644 --- a/packages/graphiql-react/src/editor/components/image-preview.tsx +++ b/packages/graphiql-react/src/editor/components/image-preview.tsx @@ -84,5 +84,5 @@ function tokenToURL(token: Token) { } function isImageURL(url: URL) { - return /(bmp|gif|jpeg|jpg|png|svg)$/.test(url.pathname); + return /\.(bmp|gif|jpe?g|png|svg|webp)$/.test(url.pathname); } diff --git a/resources/custom-words.txt b/resources/custom-words.txt index a1a3f38758d..56c382a0aa6 100644 --- a/resources/custom-words.txt +++ b/resources/custom-words.txt @@ -219,6 +219,7 @@ vitejs vitest vizag vsix +webp websockets wgutils wincent