diff --git a/.changeset/smooth-balloons-scream.md b/.changeset/smooth-balloons-scream.md new file mode 100644 index 0000000000000..2a02282346c7e --- /dev/null +++ b/.changeset/smooth-balloons-scream.md @@ -0,0 +1,6 @@ +--- +'@graphql-mesh/types': patch +'@graphql-mesh/cli': patch +--- + +Fix `createBuiltMeshHTTPHandler`'s context generic diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index cf0abbc1e5c8a..768c54e522cd2 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,19 +1,19 @@ -import { findAndParseConfig } from './config.js'; -import { getMesh, GetMeshOptions, ServeMeshOptions } from '@graphql-mesh/runtime'; -import { generateTsArtifacts } from './commands/ts-artifacts.js'; -import { serveMesh } from './commands/serve/serve.js'; -import { fs, path as pathModule, process } from '@graphql-mesh/cross-helpers'; -import { FsStoreStorageAdapter, MeshStore } from '@graphql-mesh/store'; -import { writeFile, pathExists, rmdirs, DefaultLogger, defaultImportFn } from '@graphql-mesh/utils'; -import { handleFatalError } from './handleFatalError.js'; +import { config as dotEnvRegister } from 'dotenv'; +import JSON5 from 'json5'; +import { register as tsNodeRegister } from 'ts-node'; +import { register as tsConfigPathsRegister } from 'tsconfig-paths'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; +import { fs, path as pathModule, process } from '@graphql-mesh/cross-helpers'; +import { getMesh, GetMeshOptions, ServeMeshOptions } from '@graphql-mesh/runtime'; +import { FsStoreStorageAdapter, MeshStore } from '@graphql-mesh/store'; import { Logger, YamlConfig } from '@graphql-mesh/types'; -import { register as tsNodeRegister } from 'ts-node'; -import { register as tsConfigPathsRegister } from 'tsconfig-paths'; -import { config as dotEnvRegister } from 'dotenv'; +import { defaultImportFn, DefaultLogger, pathExists, rmdirs, writeFile } from '@graphql-mesh/utils'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; -import JSON5 from 'json5'; +import { serveMesh } from './commands/serve/serve.js'; +import { generateTsArtifacts } from './commands/ts-artifacts.js'; +import { findAndParseConfig } from './config.js'; +import { handleFatalError } from './handleFatalError.js'; export { generateTsArtifacts, serveMesh, findAndParseConfig, handleFatalError }; @@ -181,8 +181,8 @@ export function getMeshOptions() { }); } -export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { - return createMeshHTTPHandler({ +export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { + return createMeshHTTPHandler({ baseDir, getBuiltMesh: ${cliParams.builtMeshFactoryName}, rawServeConfig: ${JSON.stringify(meshConfig.config.serve)}, @@ -385,8 +385,8 @@ export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { `import { createMeshHTTPHandler, MeshHTTPHandler } from '@graphql-mesh/http';`, ); meshConfig.codes.add(` -export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { - return createMeshHTTPHandler({ +export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { + return createMeshHTTPHandler({ baseDir, getBuiltMesh: ${cliParams.builtMeshFactoryName}, rawServeConfig: ${JSON.stringify(meshConfig.config.serve)}, diff --git a/packages/types/src/config.ts b/packages/types/src/config.ts index 39f0c3420a5e7..856738355d8e8 100644 --- a/packages/types/src/config.ts +++ b/packages/types/src/config.ts @@ -1970,7 +1970,6 @@ export interface PrometheusConfig { fetch?: boolean | string; fetchRequestHeaders?: boolean; fetchResponseHeaders?: boolean; - /** * Any of: Boolean, String */