@omnigraph/json-schema 1.0.0-alpha-3fc47d119.0 → 1.0.0-alpha-20230420181317-a95037648
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.
- package/README.md +5 -4
- package/cjs/addExecutionLogicToComposer.js +208 -0
- package/cjs/addRootFieldResolver.js +395 -0
- package/cjs/bundle.js +65 -0
- package/cjs/directives.js +580 -0
- package/cjs/getComposerFromJSONSchema.js +1297 -0
- package/cjs/getDereferencedJSONSchemaFromOperations.js +33 -0
- package/cjs/getGraphQLSchemaFromDereferencedJSONSchema.js +39 -0
- package/cjs/getJSONSchemaStringFormatScalarMap.js +61 -0
- package/cjs/getReferencedJSONSchemaFromOperations.js +260 -0
- package/cjs/getTypeResolverFromOutputTCs.js +69 -0
- package/cjs/getUnionTypeComposers.js +85 -0
- package/cjs/getValidTypeName.js +20 -0
- package/cjs/index.js +14 -0
- package/cjs/loadGraphQLSchemaFromJSONSchemas.js +59 -0
- package/cjs/package.json +1 -0
- package/cjs/resolveDataByUnionInputType.js +40 -0
- package/cjs/scalars.js +30 -0
- package/cjs/types.js +0 -0
- package/cjs/utils.js +65 -0
- package/esm/addExecutionLogicToComposer.js +204 -0
- package/esm/addRootFieldResolver.js +390 -0
- package/esm/bundle.js +60 -0
- package/esm/directives.js +565 -0
- package/esm/getComposerFromJSONSchema.js +1293 -0
- package/esm/getDereferencedJSONSchemaFromOperations.js +29 -0
- package/esm/getGraphQLSchemaFromDereferencedJSONSchema.js +35 -0
- package/esm/getJSONSchemaStringFormatScalarMap.js +56 -0
- package/esm/getReferencedJSONSchemaFromOperations.js +255 -0
- package/esm/getTypeResolverFromOutputTCs.js +65 -0
- package/esm/getUnionTypeComposers.js +80 -0
- package/esm/getValidTypeName.js +16 -0
- package/esm/index.js +9 -0
- package/esm/loadGraphQLSchemaFromJSONSchemas.js +54 -0
- package/esm/resolveDataByUnionInputType.js +36 -0
- package/esm/scalars.js +27 -0
- package/esm/types.js +0 -0
- package/esm/utils.js +57 -0
- package/package.json +34 -27
- package/typings/addExecutionLogicToComposer.d.cts +14 -0
- package/typings/addExecutionLogicToComposer.d.ts +14 -0
- package/typings/addRootFieldResolver.d.cts +26 -0
- package/typings/addRootFieldResolver.d.ts +26 -0
- package/typings/bundle.d.cts +34 -0
- package/typings/bundle.d.ts +34 -0
- package/typings/directives.d.cts +54 -0
- package/typings/directives.d.ts +54 -0
- package/typings/getComposerFromJSONSchema.d.cts +13 -0
- package/{getComposerFromJSONSchema.d.ts → typings/getComposerFromJSONSchema.d.ts} +7 -4
- package/typings/getDereferencedJSONSchemaFromOperations.d.cts +14 -0
- package/{getDereferencedJSONSchemaFromOperations.d.ts → typings/getDereferencedJSONSchemaFromOperations.d.ts} +5 -3
- package/typings/getGraphQLSchemaFromDereferencedJSONSchema.d.cts +5 -0
- package/typings/getGraphQLSchemaFromDereferencedJSONSchema.d.ts +5 -0
- package/typings/getJSONSchemaStringFormatScalarMap.d.cts +2 -0
- package/typings/getJSONSchemaStringFormatScalarMap.d.ts +2 -0
- package/typings/getReferencedJSONSchemaFromOperations.d.cts +16 -0
- package/{getReferencedJSONSchemaFromOperations.d.ts → typings/getReferencedJSONSchemaFromOperations.d.ts} +6 -4
- package/typings/getTypeResolverFromOutputTCs.d.cts +7 -0
- package/typings/getTypeResolverFromOutputTCs.d.ts +7 -0
- package/typings/getUnionTypeComposers.d.cts +24 -0
- package/typings/getUnionTypeComposers.d.ts +24 -0
- package/{getStringScalarWithMinMaxLength.d.ts → typings/getValidTypeName.d.cts} +4 -3
- package/typings/index.d.cts +9 -0
- package/typings/index.d.ts +9 -0
- package/typings/loadGraphQLSchemaFromJSONSchemas.d.cts +3 -0
- package/typings/loadGraphQLSchemaFromJSONSchemas.d.ts +3 -0
- package/typings/resolveDataByUnionInputType.d.cts +2 -0
- package/typings/resolveDataByUnionInputType.d.ts +2 -0
- package/typings/scalars.d.cts +4 -0
- package/typings/scalars.d.ts +4 -0
- package/typings/types.d.cts +76 -0
- package/typings/types.d.ts +76 -0
- package/typings/utils.d.cts +15 -0
- package/{utils.d.ts → typings/utils.d.ts} +1 -1
- package/addExecutionLogicToComposer.d.ts +0 -15
- package/bundle.d.ts +0 -39
- package/getGenericJSONScalar.d.ts +0 -8
- package/getGraphQLSchemaFromDereferencedJSONSchema.d.ts +0 -5
- package/getJSONSchemaStringFormatScalarMap.d.ts +0 -3
- package/getTypeResolverFromOutputTCs.d.ts +0 -4
- package/getUnionTypeComposers.d.ts +0 -21
- package/getValidateFnForSchemaPath.d.ts +0 -3
- package/index.d.ts +0 -9
- package/index.js +0 -1890
- package/index.mjs +0 -1877
- package/loadGraphQLSchemaFromJSONSchemas.d.ts +0 -2
- package/resolveDataByUnionInputType.d.ts +0 -3
- package/types.d.ts +0 -63
- package/{getValidTypeName.d.ts → typings/getValidTypeName.d.ts} +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JSONSchemaLoaderOptions } from './types.cjs';
|
|
2
|
+
export declare function loadNonExecutableGraphQLSchemaFromJSONSchemas(name: string, options: JSONSchemaLoaderOptions): Promise<import("graphql").GraphQLSchema>;
|
|
3
|
+
export declare function loadGraphQLSchemaFromJSONSchemas(name: string, options: JSONSchemaLoaderOptions): Promise<import("graphql").GraphQLSchema>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JSONSchemaLoaderOptions } from './types.js';
|
|
2
|
+
export declare function loadNonExecutableGraphQLSchemaFromJSONSchemas(name: string, options: JSONSchemaLoaderOptions): Promise<import("graphql").GraphQLSchema>;
|
|
3
|
+
export declare function loadGraphQLSchemaFromJSONSchemas(name: string, options: JSONSchemaLoaderOptions): Promise<import("graphql").GraphQLSchema>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { OperationTypeNode } from 'graphql';
|
|
2
|
+
import { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue';
|
|
3
|
+
import { JSONSchema, JSONSchemaObject } from 'json-machete';
|
|
4
|
+
import { IStringifyOptions } from 'qs';
|
|
5
|
+
import { ResolverData } from '@graphql-mesh/string-interpolation';
|
|
6
|
+
import { Logger, MeshFetch, MeshPubSub } from '@graphql-mesh/types';
|
|
7
|
+
import { BaseLoaderOptions } from '@graphql-tools/utils';
|
|
8
|
+
export interface JSONSchemaLoaderOptions extends BaseLoaderOptions {
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
operationHeaders?: OperationHeadersConfiguration;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
schemaHeaders?: Record<string, string>;
|
|
13
|
+
operations: JSONSchemaOperationConfig[];
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
pubsub?: MeshPubSub;
|
|
17
|
+
fetch?: MeshFetch;
|
|
18
|
+
ignoreErrorResponses?: boolean;
|
|
19
|
+
queryParams?: Record<string, string | number | boolean>;
|
|
20
|
+
queryStringOptions?: IStringifyOptions;
|
|
21
|
+
bundle?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface JSONSchemaOperationResponseConfig {
|
|
24
|
+
responseSchema?: string | JSONSchemaObject;
|
|
25
|
+
responseSample?: any;
|
|
26
|
+
responseTypeName?: string;
|
|
27
|
+
exposeResponseMetadata?: boolean;
|
|
28
|
+
links?: Record<string, JSONSchemaLinkConfig>;
|
|
29
|
+
}
|
|
30
|
+
export interface JSONSchemaLinkConfig {
|
|
31
|
+
fieldName: string;
|
|
32
|
+
args?: Record<string, string>;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
export type JSONSchemaBaseOperationConfig = {
|
|
36
|
+
type: OperationTypeNode;
|
|
37
|
+
field: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
argTypeMap?: Record<string, string | JSONSchemaObject>;
|
|
40
|
+
responseByStatusCode?: Record<string, JSONSchemaOperationResponseConfig>;
|
|
41
|
+
} & JSONSchemaOperationResponseConfig;
|
|
42
|
+
export type JSONSchemaBaseOperationConfigWithJSONRequest = JSONSchemaBaseOperationConfig & {
|
|
43
|
+
requestSchema?: string | JSONSchema;
|
|
44
|
+
requestSample?: any;
|
|
45
|
+
requestTypeName?: string;
|
|
46
|
+
requestBaseBody?: any;
|
|
47
|
+
};
|
|
48
|
+
export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
|
|
49
|
+
export type JSONSchemaHTTPBaseOperationConfig = JSONSchemaBaseOperationConfig & {
|
|
50
|
+
path: string;
|
|
51
|
+
method?: HTTPMethod;
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
queryParamArgMap?: Record<string, string>;
|
|
54
|
+
queryStringOptionsByParam?: Record<string, IStringifyOptions & {
|
|
55
|
+
destructObject?: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
queryParamsSample?: any;
|
|
58
|
+
};
|
|
59
|
+
export type JSONSchemaHTTPJSONOperationConfig = JSONSchemaHTTPBaseOperationConfig & JSONSchemaBaseOperationConfigWithJSONRequest;
|
|
60
|
+
export type JSONSchemaPubSubOperationConfig = JSONSchemaBaseOperationConfigWithJSONRequest & {
|
|
61
|
+
pubsubTopic: string;
|
|
62
|
+
};
|
|
63
|
+
export type JSONSchemaHTTPBinaryConfig = JSONSchemaHTTPBaseOperationConfig & {
|
|
64
|
+
path: string;
|
|
65
|
+
method?: HTTPMethod;
|
|
66
|
+
requestTypeName?: string;
|
|
67
|
+
binary: true;
|
|
68
|
+
};
|
|
69
|
+
export type JSONSchemaOperationConfig = JSONSchemaHTTPJSONOperationConfig | JSONSchemaHTTPBinaryConfig | JSONSchemaPubSubOperationConfig;
|
|
70
|
+
export type OperationHeadersConfiguration = Record<string, string> | OperationHeadersFactory;
|
|
71
|
+
export type OperationHeadersFactory = (data: ResolverData, operationConfig: {
|
|
72
|
+
endpoint: string;
|
|
73
|
+
field: string;
|
|
74
|
+
path: string;
|
|
75
|
+
method: HTTPMethod;
|
|
76
|
+
}) => PromiseOrValue<Record<string, string>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { OperationTypeNode } from 'graphql';
|
|
2
|
+
import { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue';
|
|
3
|
+
import { JSONSchema, JSONSchemaObject } from 'json-machete';
|
|
4
|
+
import { IStringifyOptions } from 'qs';
|
|
5
|
+
import { ResolverData } from '@graphql-mesh/string-interpolation';
|
|
6
|
+
import { Logger, MeshFetch, MeshPubSub } from '@graphql-mesh/types';
|
|
7
|
+
import { BaseLoaderOptions } from '@graphql-tools/utils';
|
|
8
|
+
export interface JSONSchemaLoaderOptions extends BaseLoaderOptions {
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
operationHeaders?: OperationHeadersConfiguration;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
schemaHeaders?: Record<string, string>;
|
|
13
|
+
operations: JSONSchemaOperationConfig[];
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
pubsub?: MeshPubSub;
|
|
17
|
+
fetch?: MeshFetch;
|
|
18
|
+
ignoreErrorResponses?: boolean;
|
|
19
|
+
queryParams?: Record<string, string | number | boolean>;
|
|
20
|
+
queryStringOptions?: IStringifyOptions;
|
|
21
|
+
bundle?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface JSONSchemaOperationResponseConfig {
|
|
24
|
+
responseSchema?: string | JSONSchemaObject;
|
|
25
|
+
responseSample?: any;
|
|
26
|
+
responseTypeName?: string;
|
|
27
|
+
exposeResponseMetadata?: boolean;
|
|
28
|
+
links?: Record<string, JSONSchemaLinkConfig>;
|
|
29
|
+
}
|
|
30
|
+
export interface JSONSchemaLinkConfig {
|
|
31
|
+
fieldName: string;
|
|
32
|
+
args?: Record<string, string>;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
export type JSONSchemaBaseOperationConfig = {
|
|
36
|
+
type: OperationTypeNode;
|
|
37
|
+
field: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
argTypeMap?: Record<string, string | JSONSchemaObject>;
|
|
40
|
+
responseByStatusCode?: Record<string, JSONSchemaOperationResponseConfig>;
|
|
41
|
+
} & JSONSchemaOperationResponseConfig;
|
|
42
|
+
export type JSONSchemaBaseOperationConfigWithJSONRequest = JSONSchemaBaseOperationConfig & {
|
|
43
|
+
requestSchema?: string | JSONSchema;
|
|
44
|
+
requestSample?: any;
|
|
45
|
+
requestTypeName?: string;
|
|
46
|
+
requestBaseBody?: any;
|
|
47
|
+
};
|
|
48
|
+
export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
|
|
49
|
+
export type JSONSchemaHTTPBaseOperationConfig = JSONSchemaBaseOperationConfig & {
|
|
50
|
+
path: string;
|
|
51
|
+
method?: HTTPMethod;
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
queryParamArgMap?: Record<string, string>;
|
|
54
|
+
queryStringOptionsByParam?: Record<string, IStringifyOptions & {
|
|
55
|
+
destructObject?: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
queryParamsSample?: any;
|
|
58
|
+
};
|
|
59
|
+
export type JSONSchemaHTTPJSONOperationConfig = JSONSchemaHTTPBaseOperationConfig & JSONSchemaBaseOperationConfigWithJSONRequest;
|
|
60
|
+
export type JSONSchemaPubSubOperationConfig = JSONSchemaBaseOperationConfigWithJSONRequest & {
|
|
61
|
+
pubsubTopic: string;
|
|
62
|
+
};
|
|
63
|
+
export type JSONSchemaHTTPBinaryConfig = JSONSchemaHTTPBaseOperationConfig & {
|
|
64
|
+
path: string;
|
|
65
|
+
method?: HTTPMethod;
|
|
66
|
+
requestTypeName?: string;
|
|
67
|
+
binary: true;
|
|
68
|
+
};
|
|
69
|
+
export type JSONSchemaOperationConfig = JSONSchemaHTTPJSONOperationConfig | JSONSchemaHTTPBinaryConfig | JSONSchemaPubSubOperationConfig;
|
|
70
|
+
export type OperationHeadersConfiguration = Record<string, string> | OperationHeadersFactory;
|
|
71
|
+
export type OperationHeadersFactory = (data: ResolverData, operationConfig: {
|
|
72
|
+
endpoint: string;
|
|
73
|
+
field: string;
|
|
74
|
+
path: string;
|
|
75
|
+
method: HTTPMethod;
|
|
76
|
+
}) => PromiseOrValue<Record<string, string>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OperationTypeNode } from 'graphql';
|
|
2
|
+
import { HTTPMethod, JSONSchemaOperationConfig, JSONSchemaPubSubOperationConfig } from './types.cjs';
|
|
3
|
+
export declare function isPubSubOperationConfig(operationConfig: JSONSchemaOperationConfig): operationConfig is JSONSchemaPubSubOperationConfig;
|
|
4
|
+
export declare function getOperationMetadata(operationConfig: JSONSchemaOperationConfig): {
|
|
5
|
+
httpMethod: HTTPMethod;
|
|
6
|
+
operationType: OperationTypeNode;
|
|
7
|
+
rootTypeName: "Query" | "Mutation" | "Subscription";
|
|
8
|
+
fieldName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function cleanObject(obj: any): any;
|
|
11
|
+
export declare function isFileUpload(obj: any): obj is {
|
|
12
|
+
createReadStream: () => AsyncIterable<Uint8Array>;
|
|
13
|
+
mimetype: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function isFile(obj: any): obj is File;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationTypeNode } from 'graphql';
|
|
2
|
-
import { JSONSchemaOperationConfig, JSONSchemaPubSubOperationConfig
|
|
2
|
+
import { HTTPMethod, JSONSchemaOperationConfig, JSONSchemaPubSubOperationConfig } from './types.js';
|
|
3
3
|
export declare function isPubSubOperationConfig(operationConfig: JSONSchemaOperationConfig): operationConfig is JSONSchemaPubSubOperationConfig;
|
|
4
4
|
export declare function getOperationMetadata(operationConfig: JSONSchemaOperationConfig): {
|
|
5
5
|
httpMethod: HTTPMethod;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SchemaComposer } from 'graphql-compose';
|
|
2
|
-
import { Logger, MeshPubSub } from '@graphql-mesh/types';
|
|
3
|
-
import { JSONSchemaOperationConfig } from './types';
|
|
4
|
-
import { IStringifyOptions } from 'qs';
|
|
5
|
-
export interface AddExecutionLogicToComposerOptions {
|
|
6
|
-
baseUrl: string;
|
|
7
|
-
operations: JSONSchemaOperationConfig[];
|
|
8
|
-
operationHeaders?: Record<string, string>;
|
|
9
|
-
fetch: WindowOrWorkerGlobalScope['fetch'];
|
|
10
|
-
logger: Logger;
|
|
11
|
-
pubsub?: MeshPubSub;
|
|
12
|
-
queryParams?: Record<string, string>;
|
|
13
|
-
queryStringOptions?: IStringifyOptions;
|
|
14
|
-
}
|
|
15
|
-
export declare function addExecutionLogicToComposer(schemaComposer: SchemaComposer, { fetch: globalFetch, logger, operations, operationHeaders, baseUrl, pubsub: globalPubsub, queryParams, queryStringOptions, }: AddExecutionLogicToComposerOptions): Promise<SchemaComposer<any>>;
|
package/bundle.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaObject } from 'json-machete';
|
|
2
|
-
import { Logger, MeshPubSub } from '@graphql-mesh/types';
|
|
3
|
-
import { JSONSchemaOperationConfig } from './types';
|
|
4
|
-
import { GraphQLSchema } from 'graphql';
|
|
5
|
-
import type { IStringifyOptions } from 'qs';
|
|
6
|
-
export interface JSONSchemaLoaderBundle {
|
|
7
|
-
name?: string;
|
|
8
|
-
baseUrl?: string;
|
|
9
|
-
operations: JSONSchemaOperationConfig[];
|
|
10
|
-
operationHeaders?: Record<string, string>;
|
|
11
|
-
referencedSchema: JSONSchemaObject;
|
|
12
|
-
}
|
|
13
|
-
export interface JSONSchemaLoaderBundleOptions {
|
|
14
|
-
baseUrl?: string;
|
|
15
|
-
operations: JSONSchemaOperationConfig[];
|
|
16
|
-
schemaHeaders?: Record<string, string>;
|
|
17
|
-
operationHeaders?: Record<string, string>;
|
|
18
|
-
cwd?: string;
|
|
19
|
-
ignoreErrorResponses?: boolean;
|
|
20
|
-
noDeduplication?: boolean;
|
|
21
|
-
fetch?: WindowOrWorkerGlobalScope['fetch'];
|
|
22
|
-
logger?: Logger;
|
|
23
|
-
}
|
|
24
|
-
export declare function createBundle(name: string, { baseUrl, operations, schemaHeaders, operationHeaders, cwd, fetch, logger, ignoreErrorResponses, noDeduplication, }: JSONSchemaLoaderBundleOptions): Promise<JSONSchemaLoaderBundle>;
|
|
25
|
-
export interface JSONSchemaLoaderBundleToGraphQLSchemaOptions {
|
|
26
|
-
cwd?: string;
|
|
27
|
-
fetch?: WindowOrWorkerGlobalScope['fetch'];
|
|
28
|
-
pubsub?: MeshPubSub;
|
|
29
|
-
logger?: Logger;
|
|
30
|
-
baseUrl?: string;
|
|
31
|
-
operationHeaders?: Record<string, string>;
|
|
32
|
-
queryParams?: Record<string, string>;
|
|
33
|
-
queryStringOptions?: IStringifyOptions;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Generates a local GraphQLSchema instance from
|
|
37
|
-
* previously generated JSON Schema bundle
|
|
38
|
-
*/
|
|
39
|
-
export declare function getGraphQLSchemaFromBundle({ name, baseUrl: bundledBaseUrl, operations, operationHeaders: bundledOperationHeaders, referencedSchema, }: JSONSchemaLoaderBundle, { cwd, fetch, pubsub, logger, baseUrl: overwrittenBaseUrl, operationHeaders: additionalOperationHeaders, queryParams, queryStringOptions, }?: JSONSchemaLoaderBundleToGraphQLSchemaOptions): Promise<GraphQLSchema>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaObject } from 'json-machete';
|
|
2
|
-
import { SchemaComposer } from 'graphql-compose';
|
|
3
|
-
export declare function getGenericJSONScalar({ isInput, subSchema, schemaComposer, validateWithJSONSchema, }: {
|
|
4
|
-
isInput: boolean;
|
|
5
|
-
subSchema: JSONSchemaObject;
|
|
6
|
-
schemaComposer: SchemaComposer<any>;
|
|
7
|
-
validateWithJSONSchema: (data: any) => boolean;
|
|
8
|
-
}): import("graphql-compose").ScalarTypeComposer<any>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaObject } from 'json-machete';
|
|
2
|
-
import { AddExecutionLogicToComposerOptions } from './addExecutionLogicToComposer';
|
|
3
|
-
export declare function getGraphQLSchemaFromDereferencedJSONSchema(fullyDeferencedSchema: JSONSchemaObject, { fetch, logger, operations, operationHeaders, baseUrl, pubsub, generateInterfaceFromSharedFields, queryParams, queryStringOptions, }: AddExecutionLogicToComposerOptions & {
|
|
4
|
-
generateInterfaceFromSharedFields?: boolean;
|
|
5
|
-
}): Promise<import("graphql").GraphQLSchema>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { GraphQLTypeResolver } from 'graphql';
|
|
2
|
-
import { ObjectTypeComposer, UnionTypeComposer } from 'graphql-compose';
|
|
3
|
-
import Ajv from 'ajv';
|
|
4
|
-
export declare function getTypeResolverFromOutputTCs(ajv: Ajv, outputTypeComposers: (ObjectTypeComposer | UnionTypeComposer)[], statusCodeOneOfIndexMap?: Record<string, number>): GraphQLTypeResolver<any, any>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaObject } from '@json-schema-tools/meta-schema';
|
|
2
|
-
import Ajv from 'ajv';
|
|
3
|
-
import { AnyTypeComposer, ObjectTypeComposer, SchemaComposer, UnionTypeComposer } from 'graphql-compose';
|
|
4
|
-
export interface GetUnionTypeComposersOpts {
|
|
5
|
-
schemaComposer: SchemaComposer;
|
|
6
|
-
ajv: Ajv;
|
|
7
|
-
typeComposersList: {
|
|
8
|
-
input?: AnyTypeComposer<any>;
|
|
9
|
-
output?: ObjectTypeComposer | UnionTypeComposer;
|
|
10
|
-
}[];
|
|
11
|
-
subSchema: JSONSchemaObject;
|
|
12
|
-
generateInterfaceFromSharedFields: boolean;
|
|
13
|
-
statusCodeOneOfIndexMap?: Record<string, number>;
|
|
14
|
-
}
|
|
15
|
-
export declare function getUnionTypeComposers({ schemaComposer, ajv, typeComposersList, subSchema, generateInterfaceFromSharedFields, statusCodeOneOfIndexMap, }: GetUnionTypeComposersOpts): {
|
|
16
|
-
input?: AnyTypeComposer<any>;
|
|
17
|
-
output?: ObjectTypeComposer<any, any> | UnionTypeComposer<any, any>;
|
|
18
|
-
} | {
|
|
19
|
-
input: import("graphql-compose").InputTypeComposer<any>;
|
|
20
|
-
output: import("graphql-compose").InterfaceTypeComposer<any, any> | UnionTypeComposer<any, any>;
|
|
21
|
-
};
|
package/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { loadGraphQLSchemaFromJSONSchemas } from './loadGraphQLSchemaFromJSONSchemas';
|
|
2
|
-
export default loadGraphQLSchemaFromJSONSchemas;
|
|
3
|
-
export { loadGraphQLSchemaFromJSONSchemas };
|
|
4
|
-
export * from './getComposerFromJSONSchema';
|
|
5
|
-
export * from './getDereferencedJSONSchemaFromOperations';
|
|
6
|
-
export * from './getReferencedJSONSchemaFromOperations';
|
|
7
|
-
export * from './getGraphQLSchemaFromDereferencedJSONSchema';
|
|
8
|
-
export * from './types';
|
|
9
|
-
export * from './bundle';
|