@graphql-mesh/compose-cli 1.4.18 → 1.5.0-alpha-20251014113438-31059ca3d9020d53f08d8d81801965899cecbd27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULT_INTROSPECTION_OPTIONS = void 0;
36
37
  exports.loadGraphQLHTTPSubgraph = loadGraphQLHTTPSubgraph;
37
38
  const graphql_1 = require("graphql");
38
39
  const string_interpolation_1 = require("@graphql-mesh/string-interpolation");
@@ -155,7 +156,15 @@ function fixExtends(node) {
155
156
  },
156
157
  });
157
158
  }
158
- function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, federation = false, transportKind = 'http', }) {
159
+ exports.DEFAULT_INTROSPECTION_OPTIONS = {
160
+ descriptions: true,
161
+ specifiedByUrl: false,
162
+ directiveIsRepeatable: false,
163
+ schemaDescription: false,
164
+ inputValueDeprecation: true,
165
+ oneOf: false,
166
+ };
167
+ function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, introspectionOptions = exports.DEFAULT_INTROSPECTION_OPTIONS, federation = false, transportKind = 'http', }) {
159
168
  return (ctx) => {
160
169
  let schema$;
161
170
  const interpolationData = {
@@ -209,7 +218,7 @@ function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGETForQuer
209
218
  ...schemaHeaders,
210
219
  },
211
220
  body: JSON.stringify({
212
- query: (0, graphql_1.getIntrospectionQuery)(),
221
+ query: (0, graphql_1.getIntrospectionQuery)(introspectionOptions),
213
222
  }),
214
223
  }), res => {
215
224
  assertResponseOk(res);
@@ -119,7 +119,15 @@ function fixExtends(node) {
119
119
  },
120
120
  });
121
121
  }
122
- export function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, federation = false, transportKind = 'http', }) {
122
+ export const DEFAULT_INTROSPECTION_OPTIONS = {
123
+ descriptions: true,
124
+ specifiedByUrl: false,
125
+ directiveIsRepeatable: false,
126
+ schemaDescription: false,
127
+ inputValueDeprecation: true,
128
+ oneOf: false,
129
+ };
130
+ export function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, introspectionOptions = DEFAULT_INTROSPECTION_OPTIONS, federation = false, transportKind = 'http', }) {
123
131
  return (ctx) => {
124
132
  let schema$;
125
133
  const interpolationData = {
@@ -173,7 +181,7 @@ export function loadGraphQLHTTPSubgraph(subgraphName, { endpoint, method, useGET
173
181
  ...schemaHeaders,
174
182
  },
175
183
  body: JSON.stringify({
176
- query: getIntrospectionQuery(),
184
+ query: getIntrospectionQuery(introspectionOptions),
177
185
  }),
178
186
  }), res => {
179
187
  assertResponseOk(res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/compose-cli",
3
- "version": "1.4.18",
3
+ "version": "1.5.0-alpha-20251014113438-31059ca3d9020d53f08d8d81801965899cecbd27",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
@@ -1,3 +1,4 @@
1
+ import { type IntrospectionOptions } from 'graphql';
1
2
  import type { MeshComposeCLISourceHandlerDef } from './types.cjs';
2
3
  export interface GraphQLSubgraphLoaderHTTPConfiguration {
3
4
  /**
@@ -56,5 +57,24 @@ export interface GraphQLSubgraphLoaderHTTPConfiguration {
56
57
  * @default 'http'
57
58
  */
58
59
  transportKind?: 'http';
60
+ /**
61
+ * While introspecting the schema, you can customize the introspection query by providing these options.
62
+ * This is useful if you have a GraphQL server that does not support some of the newer features of GraphQL.
63
+ *
64
+ * By default, Mesh has the following options;
65
+ *
66
+ * ```json
67
+ * {
68
+ * "descriptions": true,
69
+ * "specifiedByUrl": false,
70
+ * "directiveIsRepeatable": false,
71
+ * "schemaDescription": false,
72
+ * "inputValueDeprecation": true,
73
+ * "oneOf": false
74
+ * }
75
+ * ```
76
+ */
77
+ introspectionOptions?: IntrospectionOptions;
59
78
  }
60
- export declare function loadGraphQLHTTPSubgraph(subgraphName: string, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, federation, transportKind, }: GraphQLSubgraphLoaderHTTPConfiguration): MeshComposeCLISourceHandlerDef;
79
+ export declare const DEFAULT_INTROSPECTION_OPTIONS: Required<IntrospectionOptions>;
80
+ export declare function loadGraphQLHTTPSubgraph(subgraphName: string, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, introspectionOptions, federation, transportKind, }: GraphQLSubgraphLoaderHTTPConfiguration): MeshComposeCLISourceHandlerDef;
@@ -1,3 +1,4 @@
1
+ import { type IntrospectionOptions } from 'graphql';
1
2
  import type { MeshComposeCLISourceHandlerDef } from './types.js';
2
3
  export interface GraphQLSubgraphLoaderHTTPConfiguration {
3
4
  /**
@@ -56,5 +57,24 @@ export interface GraphQLSubgraphLoaderHTTPConfiguration {
56
57
  * @default 'http'
57
58
  */
58
59
  transportKind?: 'http';
60
+ /**
61
+ * While introspecting the schema, you can customize the introspection query by providing these options.
62
+ * This is useful if you have a GraphQL server that does not support some of the newer features of GraphQL.
63
+ *
64
+ * By default, Mesh has the following options;
65
+ *
66
+ * ```json
67
+ * {
68
+ * "descriptions": true,
69
+ * "specifiedByUrl": false,
70
+ * "directiveIsRepeatable": false,
71
+ * "schemaDescription": false,
72
+ * "inputValueDeprecation": true,
73
+ * "oneOf": false
74
+ * }
75
+ * ```
76
+ */
77
+ introspectionOptions?: IntrospectionOptions;
59
78
  }
60
- export declare function loadGraphQLHTTPSubgraph(subgraphName: string, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, federation, transportKind, }: GraphQLSubgraphLoaderHTTPConfiguration): MeshComposeCLISourceHandlerDef;
79
+ export declare const DEFAULT_INTROSPECTION_OPTIONS: Required<IntrospectionOptions>;
80
+ export declare function loadGraphQLHTTPSubgraph(subgraphName: string, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, introspectionOptions, federation, transportKind, }: GraphQLSubgraphLoaderHTTPConfiguration): MeshComposeCLISourceHandlerDef;