From a1bfc492ac3378f22b79a51824407e776b496a84 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Fri, 2 Aug 2024 17:55:41 +0300 Subject: [PATCH] Remove unused `trustProxy` in the config --- .changeset/rotten-readers-flash.md | 8 ++++++++ packages/legacy/cli/src/commands/serve/serve.ts | 2 -- .../legacy/cli/src/commands/serve/yaml-config.graphql | 5 ----- packages/legacy/http/src/index.ts | 2 -- packages/legacy/types/src/config-schema.json | 4 ---- packages/legacy/types/src/config.ts | 5 ----- website/src/generated-markdown/ServeConfig.generated.md | 2 -- 7 files changed, 8 insertions(+), 20 deletions(-) create mode 100644 .changeset/rotten-readers-flash.md diff --git a/.changeset/rotten-readers-flash.md b/.changeset/rotten-readers-flash.md new file mode 100644 index 0000000000000..2cae4bac29398 --- /dev/null +++ b/.changeset/rotten-readers-flash.md @@ -0,0 +1,8 @@ +--- +'@graphql-mesh/cli': patch +'@graphql-mesh/types': patch +--- + +Removed non-functional \`trustProxy\` option in the config schema +This might cause a non-functional config schemna validation warning +This change does not have any impact on the functionality of the Mesh diff --git a/packages/legacy/cli/src/commands/serve/serve.ts b/packages/legacy/cli/src/commands/serve/serve.ts index 8f6049488ca3f..164efaff00b8b 100644 --- a/packages/legacy/cli/src/commands/serve/serve.ts +++ b/packages/legacy/cli/src/commands/serve/serve.ts @@ -54,8 +54,6 @@ export async function serveMesh( sslCredentials, endpoint: graphqlPath = '/graphql', browser = process.env.NODE_ENV?.toLowerCase() !== 'production', - // TODO - // trustProxy = 'loopback', } = rawServeConfig; const port = portSelectorFn( diff --git a/packages/legacy/cli/src/commands/serve/yaml-config.graphql b/packages/legacy/cli/src/commands/serve/yaml-config.graphql index 08a64750dac03..135b88ecb6259 100644 --- a/packages/legacy/cli/src/commands/serve/yaml-config.graphql +++ b/packages/legacy/cli/src/commands/serve/yaml-config.graphql @@ -58,11 +58,6 @@ type ServeConfig @md { """ playgroundTitle: String """ - Configure Express Proxy Handling - [Learn more](https://expressjs.com/en/guide/behind-proxies.html) - """ - trustProxy: String - """ Enable and define a limit for [Request Batching](https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md) """ batchingLimit: Int diff --git a/packages/legacy/http/src/index.ts b/packages/legacy/http/src/index.ts index 87e960acfafeb..c81388519bab7 100644 --- a/packages/legacy/http/src/index.ts +++ b/packages/legacy/http/src/index.ts @@ -28,8 +28,6 @@ export function createMeshHTTPHandler({ endpoint: graphqlPath = '/graphql', batchingLimit, healthCheckEndpoint = '/healthcheck', - // TODO - // trustProxy = 'loopback', extraParamNames, } = rawServeConfig; diff --git a/packages/legacy/types/src/config-schema.json b/packages/legacy/types/src/config-schema.json index 65d8e89177f3c..ce8a42e5aa434 100644 --- a/packages/legacy/types/src/config-schema.json +++ b/packages/legacy/types/src/config-schema.json @@ -162,10 +162,6 @@ "type": "string", "description": "Title of GraphiQL Playground" }, - "trustProxy": { - "type": "string", - "description": "Configure Express Proxy Handling\n[Learn more](https://expressjs.com/en/guide/behind-proxies.html)" - }, "batchingLimit": { "type": "integer", "description": "Enable and define a limit for [Request Batching](https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md)" diff --git a/packages/legacy/types/src/config.ts b/packages/legacy/types/src/config.ts index ba47dc9561d4c..4d3db997c95e4 100644 --- a/packages/legacy/types/src/config.ts +++ b/packages/legacy/types/src/config.ts @@ -112,11 +112,6 @@ export interface ServeConfig { * Title of GraphiQL Playground */ playgroundTitle?: string; - /** - * Configure Express Proxy Handling - * [Learn more](https://expressjs.com/en/guide/behind-proxies.html) - */ - trustProxy?: string; /** * Enable and define a limit for [Request Batching](https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md) */ diff --git a/website/src/generated-markdown/ServeConfig.generated.md b/website/src/generated-markdown/ServeConfig.generated.md index c50474ebfb4f6..3fa3e11ba1b76 100644 --- a/website/src/generated-markdown/ServeConfig.generated.md +++ b/website/src/generated-markdown/ServeConfig.generated.md @@ -26,8 +26,6 @@ This feature can be disabled by passing `false` One of: * `String` * `Boolean` * `playgroundTitle` (type: `String`) - Title of GraphiQL Playground -* `trustProxy` (type: `String`) - Configure Express Proxy Handling -[Learn more](https://expressjs.com/en/guide/behind-proxies.html) * `batchingLimit` (type: `Int`) - Enable and define a limit for [Request Batching](https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md) * `healthCheckEndpoint` (type: `String`) - Endpoint for [Health Check](https://the-guild.dev/graphql/yoga-server/docs/features/health-check) * `extraParamNames` (type: `Array of String`) - By default, GraphQL Mesh does not allow parameters in the request body except `query`, `variables`, `extensions`, and `operationName`.