Procházet zdrojové kódy

docs(core): Update middleware example for Express v5

Relates to #3532
Michael Bromley před 7 měsíci
rodič
revize
e9d4f4d98d

+ 24 - 3
docs/docs/reference/core-plugins/graphiql-plugin/index.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## GraphiqlPlugin
 
-<GenerationInfo sourceFile="packages/graphiql-plugin/src/plugin.ts" sourceLine="43" packageName="@vendure/graphiql-plugin" />
+<GenerationInfo sourceFile="packages/graphiql-plugin/src/plugin.ts" sourceLine="64" packageName="@vendure/graphiql-plugin" />
 
 This plugin provides a GraphiQL UI for exploring and testing the Vendure GraphQL APIs.
 
@@ -21,18 +21,39 @@ for the respective APIs.
 ## Installation
 
 ```ts
-import { GraphiQLPlugin } from '@vendure/graphiql-plugin';
+import { GraphiqlPlugin } from '@vendure/graphiql-plugin';
 
 const config: VendureConfig = {
   // Add an instance of the plugin to the plugins array
   plugins: [
-    GraphiQLPlugin.init({
+    GraphiqlPlugin.init({
       route: 'graphiql', // Optional, defaults to 'graphiql'
     }),
   ],
 };
 ```
 
+## Custom API paths
+
+By default, the plugin automatically reads the Admin API and Shop API paths from your Vendure configuration.
+
+If you need to override these paths, you can specify them explicitly:
+
+```typescript
+GraphiQLPlugin.init({
+    route: 'my-custom-route', // defaults to `graphiql`
+});
+```
+
+## Query parameters
+
+You can add the following query parameters to the GraphiQL URL:
+
+- `?query=...` - Pre-populate the query editor with a GraphQL query.
+- `?embeddedMode=true` - This renders the editor in embedded mode, which hides the header and
+   the API switcher. This is useful for embedding GraphiQL in other applications such as documentation.
+   In this mode, the editor also does not persist changes across reloads.
+
 ```ts title="Signature"
 class GraphiqlPlugin implements NestModule {
     static options: Required<GraphiqlPluginOptions>;

+ 3 - 3
docs/docs/reference/dashboard/components/page-action-bar.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## PageActionBar
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="262" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="261" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -32,7 +32,7 @@ Parameters
 
 ## PageActionBarLeft
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="288" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="287" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -49,7 +49,7 @@ Parameters
 
 ## PageActionBarRight
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="300" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="299" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 

+ 4 - 4
docs/docs/reference/dashboard/components/page-block.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## PageBlock
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="352" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="351" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -32,7 +32,7 @@ Parameters
 
 ## PageBlockProps
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="329" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="328" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -86,7 +86,7 @@ type PageBlockProps = {
 
 ## FullWidthPageBlock
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="379" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="378" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -106,7 +106,7 @@ Parameters
 
 ## CustomFieldsPageBlock
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="401" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="400" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 

+ 2 - 2
docs/docs/reference/dashboard/components/page-layout.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## PageLayout
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="158" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="157" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 
@@ -31,7 +31,7 @@ Parameters
 
 ## PageLayoutProps
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="128" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="127" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 

+ 1 - 1
docs/docs/reference/dashboard/components/page-title.md

@@ -11,7 +11,7 @@ import MemberDescription from '@site/src/components/MemberDescription';
 
 ## PageTitle
 
-<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="245" packageName="@vendure/dashboard" since="3.3.0" />
+<GenerationInfo sourceFile="packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx" sourceLine="244" packageName="@vendure/dashboard" since="3.3.0" />
 
 **Status: Developer Preview**
 

+ 1 - 1
docs/docs/reference/typescript-api/common/middleware.md

@@ -33,7 +33,7 @@ export const config: VendureConfig = {
   apiOptions: {
     middleware: [{
       handler: json({ limit: '10mb' }),
-      route: '*',
+      route: '*splat',
       beforeListen: true,
     }],
   },

+ 1 - 1
docs/docs/reference/typescript-api/scheduled-tasks/clean-sessions-task.md

@@ -33,7 +33,7 @@ export const config: VendureConfig = {
         schedule: cron => cron.everyDayAt(3, 0),
         params: {
           // How many sessions to process in each batch
-          // Default: 10_000
+          // Default: 1000
           batchSize: 5_000,
         },
       }),

+ 1 - 1
packages/core/src/common/types/common-types.ts

@@ -200,7 +200,7 @@ export type MiddlewareHandler = Type<any> | Function;
  *   apiOptions: {
  *     middleware: [{
  *       handler: json({ limit: '10mb' }),
- *       route: '*',
+ *       route: '*splat',
  *       beforeListen: true,
  *     }],
  *   },