diff --git a/.changeset/fifty-numbers-draw.md b/.changeset/fifty-numbers-draw.md
new file mode 100644
index 00000000000..f8ca31e749d
--- /dev/null
+++ b/.changeset/fifty-numbers-draw.md
@@ -0,0 +1,6 @@
+---
+'graphiql': patch
+'@graphiql/react': patch
+---
+
+fix display of deprecation reason on field type docs
diff --git a/packages/graphiql-react/src/explorer/components/deprecation-reason.tsx b/packages/graphiql-react/src/explorer/components/deprecation-reason.tsx
index 84a9170638c..d61964a1205 100644
--- a/packages/graphiql-react/src/explorer/components/deprecation-reason.tsx
+++ b/packages/graphiql-react/src/explorer/components/deprecation-reason.tsx
@@ -7,13 +7,17 @@ type DeprecationReasonProps = {
* The deprecation reason as markdown string.
*/
children?: string | null;
+ preview?: boolean;
};
export function DeprecationReason(props: DeprecationReasonProps) {
return props.children ? (
Deprecated
-
+
{props.children}
diff --git a/packages/graphiql-react/src/explorer/components/field-documentation.tsx b/packages/graphiql-react/src/explorer/components/field-documentation.tsx
index 90b210be2d1..3ed044be5c4 100644
--- a/packages/graphiql-react/src/explorer/components/field-documentation.tsx
+++ b/packages/graphiql-react/src/explorer/components/field-documentation.tsx
@@ -24,7 +24,9 @@ export function FieldDocumentation(props: FieldDocumentationProps) {
{props.field.description}
) : null}
- {props.field.deprecationReason}
+
+ {props.field.deprecationReason}
+
diff --git a/packages/graphiql/resources/webpack.config.js b/packages/graphiql/resources/webpack.config.js
index 20b85d82ba4..15b1f7d8619 100644
--- a/packages/graphiql/resources/webpack.config.js
+++ b/packages/graphiql/resources/webpack.config.js
@@ -12,7 +12,7 @@ const relPath = (...args) => path.resolve(__dirname, ...args);
const rootPath = (...args) => relPath('../', ...args);
const resultConfig = ({ isDev = false }) => {
- const isHMR = Boolean(isDev && process.env.WEBPACK_DEV_SERVER);
+ const isHMR = Boolean(isDev && process.env.WEBPACK_SERVE);
const config = {
mode: isDev ? 'development' : 'production',
@@ -126,8 +126,8 @@ const resultConfig = ({ isDev = false }) => {
}
return config;
};
-
-module.exports = [
- resultConfig({ isDev: true }),
- resultConfig({ isDev: false }),
-];
+const configs = [resultConfig({ isDev: true })];
+if (!process.env.WEBPACK_SERVE) {
+ configs.push(resultConfig({ isDev: false }));
+}
+module.exports = configs;