nitro-graphql 2.0.0-beta.2 → 2.0.0-beta.20
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 +855 -5
- package/dist/ecosystem/nuxt.mjs +109 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +16 -0
- package/dist/rollup.d.mts +12 -0
- package/dist/rollup.mjs +282 -0
- package/dist/routes/apollo-server.d.mts +6 -0
- package/dist/routes/{apollo-server.js → apollo-server.mjs} +5 -5
- package/dist/routes/debug.d.mts +61 -0
- package/dist/routes/debug.mjs +445 -0
- package/dist/routes/graphql-yoga.d.mts +6 -0
- package/dist/routes/{graphql-yoga.js → graphql-yoga.mjs} +5 -5
- package/dist/routes/health.d.mts +10 -0
- package/dist/routes/{health.js → health.mjs} +1 -0
- package/dist/setup.d.mts +11 -0
- package/dist/setup.mjs +390 -0
- package/dist/types/index.d.mts +246 -0
- package/dist/utils/{apollo.js → apollo.mjs} +2 -2
- package/dist/utils/{client-codegen.d.ts → client-codegen.d.mts} +3 -3
- package/dist/utils/{client-codegen.js → client-codegen.mjs} +4 -4
- package/dist/utils/file-generator.d.mts +37 -0
- package/dist/utils/file-generator.mjs +72 -0
- package/dist/utils/{index.d.ts → index.d.mts} +2 -2
- package/dist/utils/{index.js → index.mjs} +63 -35
- package/dist/utils/path-resolver.d.mts +70 -0
- package/dist/utils/path-resolver.mjs +127 -0
- package/dist/utils/{server-codegen.d.ts → server-codegen.d.mts} +1 -1
- package/dist/utils/{server-codegen.js → server-codegen.mjs} +1 -1
- package/dist/utils/{type-generation.js → type-generation.mjs} +153 -42
- package/dist/virtual/debug-info.d.mts +9 -0
- package/dist/virtual/debug-info.mjs +26 -0
- package/dist/virtual/graphql-config.d.mts +9 -0
- package/dist/virtual/graphql-config.mjs +10 -0
- package/dist/virtual/module-config.d.mts +9 -0
- package/dist/virtual/module-config.mjs +10 -0
- package/dist/virtual/server-directives.d.mts +11 -0
- package/dist/virtual/server-directives.mjs +10 -0
- package/dist/virtual/server-resolvers.d.mts +11 -0
- package/dist/virtual/server-resolvers.mjs +10 -0
- package/dist/virtual/server-schemas.d.mts +11 -0
- package/dist/virtual/server-schemas.mjs +10 -0
- package/dist/vite.d.mts +27 -0
- package/dist/vite.mjs +49 -0
- package/package.json +72 -58
- package/dist/ecosystem/nuxt.js +0 -67
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -264
- package/dist/rollup.js +0 -114
- package/dist/routes/apollo-server.d.ts +0 -6
- package/dist/routes/graphql-yoga.d.ts +0 -6
- package/dist/routes/health.d.ts +0 -6
- package/dist/types/index.d.ts +0 -128
- /package/dist/ecosystem/{nuxt.d.ts → nuxt.d.mts} +0 -0
- /package/dist/graphql/{index.d.ts → index.d.mts} +0 -0
- /package/dist/graphql/{index.js → index.mjs} +0 -0
- /package/dist/graphql/{server.d.ts → server.d.mts} +0 -0
- /package/dist/graphql/{server.js → server.mjs} +0 -0
- /package/dist/types/{standard-schema.d.ts → standard-schema.d.mts} +0 -0
- /package/dist/utils/{apollo.d.ts → apollo.d.mts} +0 -0
- /package/dist/utils/{define.d.ts → define.d.mts} +0 -0
- /package/dist/utils/{define.js → define.mjs} +0 -0
- /package/dist/utils/{directive-parser.d.ts → directive-parser.d.mts} +0 -0
- /package/dist/utils/{directive-parser.js → directive-parser.mjs} +0 -0
- /package/dist/utils/{type-generation.d.ts → type-generation.d.mts} +0 -0
package/dist/types/index.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { StandardSchemaV1 } from "./standard-schema.js";
|
|
2
|
-
import { ESMCodeGenOptions } from "knitwork";
|
|
3
|
-
import { IResolvers } from "@graphql-tools/utils";
|
|
4
|
-
import { TypeScriptPluginConfig } from "@graphql-codegen/typescript";
|
|
5
|
-
import { plugin as plugin$1 } from "@graphql-codegen/typescript-generic-sdk";
|
|
6
|
-
import { TypeScriptDocumentsPluginConfig } from "@graphql-codegen/typescript-operations";
|
|
7
|
-
import { TypeScriptResolversPluginConfig } from "@graphql-codegen/typescript-resolvers";
|
|
8
|
-
|
|
9
|
-
//#region src/types/index.d.ts
|
|
10
|
-
type CodegenServerConfig = TypeScriptPluginConfig & TypeScriptResolversPluginConfig;
|
|
11
|
-
type DocumentModeConfig = Pick<Parameters<typeof plugin$1>[2], 'documentMode'>;
|
|
12
|
-
type DocumentModeEnum = NonNullable<DocumentModeConfig['documentMode']>;
|
|
13
|
-
type DocumentModeType = `${DocumentModeEnum}`;
|
|
14
|
-
type GenericSdkConfig = Omit<Parameters<typeof plugin$1>[2], 'documentMode'> & {
|
|
15
|
-
documentMode?: DocumentModeType;
|
|
16
|
-
};
|
|
17
|
-
type CodegenClientConfig = TypeScriptPluginConfig & TypeScriptDocumentsPluginConfig & {
|
|
18
|
-
endpoint?: string;
|
|
19
|
-
};
|
|
20
|
-
interface IESMImport {
|
|
21
|
-
name: string;
|
|
22
|
-
as?: string;
|
|
23
|
-
type: 'resolver' | 'query' | 'mutation' | 'type' | 'subscription' | 'directive';
|
|
24
|
-
}
|
|
25
|
-
interface GenImport {
|
|
26
|
-
specifier: string;
|
|
27
|
-
imports: IESMImport[];
|
|
28
|
-
options?: ESMCodeGenOptions;
|
|
29
|
-
}
|
|
30
|
-
declare module 'nitro/types' {
|
|
31
|
-
interface Nitro {
|
|
32
|
-
scanSchemas: string[];
|
|
33
|
-
scanDocuments: string[];
|
|
34
|
-
scanResolvers: GenImport[];
|
|
35
|
-
scanDirectives: GenImport[];
|
|
36
|
-
graphql: {
|
|
37
|
-
buildDir: string;
|
|
38
|
-
watchDirs: string[];
|
|
39
|
-
clientDir: string;
|
|
40
|
-
serverDir: string;
|
|
41
|
-
dir: {
|
|
42
|
-
build: string;
|
|
43
|
-
client: string;
|
|
44
|
-
server: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
declare module 'nitro/types' {
|
|
50
|
-
interface NitroOptions {
|
|
51
|
-
graphql?: NitroGraphQLOptions;
|
|
52
|
-
}
|
|
53
|
-
interface NitroRuntimeConfig {
|
|
54
|
-
graphql?: NitroGraphQLOptions;
|
|
55
|
-
}
|
|
56
|
-
interface NitroConfig {
|
|
57
|
-
graphql?: NitroGraphQLOptions;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
interface ExternalGraphQLService {
|
|
61
|
-
/** Unique name for this service (used for file naming and type generation) */
|
|
62
|
-
name: string;
|
|
63
|
-
/** Schema source - can be URL(s) for remote schemas or file path(s) for local schemas */
|
|
64
|
-
schema: string | string[];
|
|
65
|
-
/** GraphQL endpoint for this service */
|
|
66
|
-
endpoint: string;
|
|
67
|
-
/** Optional headers for schema introspection and client requests */
|
|
68
|
-
headers?: Record<string, string> | (() => Record<string, string>);
|
|
69
|
-
/** Optional: specific document patterns for this service */
|
|
70
|
-
documents?: string[];
|
|
71
|
-
/**
|
|
72
|
-
* Optional: Download and cache schema locally for offline usage
|
|
73
|
-
* - true or 'once': Download if file doesn't exist, then use cached version (offline-friendly)
|
|
74
|
-
* - 'always': Check for updates on every build (current behavior)
|
|
75
|
-
* - 'manual': Never download automatically, user manages schema files manually
|
|
76
|
-
* - false: Disable schema downloading
|
|
77
|
-
*/
|
|
78
|
-
downloadSchema?: boolean | 'once' | 'always' | 'manual';
|
|
79
|
-
/** Optional: Custom path to save downloaded schema (default: .nitro/graphql/schemas/[serviceName].graphql) */
|
|
80
|
-
downloadPath?: string;
|
|
81
|
-
/** Optional: service-specific codegen configuration */
|
|
82
|
-
codegen?: {
|
|
83
|
-
client?: CodegenClientConfig;
|
|
84
|
-
clientSDK?: GenericSdkConfig;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
interface FederationConfig {
|
|
88
|
-
/** Enable Apollo Federation subgraph support */
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
/** Service name for federation (used in subgraph config) */
|
|
91
|
-
serviceName?: string;
|
|
92
|
-
/** Service version for federation */
|
|
93
|
-
serviceVersion?: string;
|
|
94
|
-
/** Service URL for federation gateway */
|
|
95
|
-
serviceUrl?: string;
|
|
96
|
-
}
|
|
97
|
-
interface NitroGraphQLOptions {
|
|
98
|
-
framework: 'graphql-yoga' | 'apollo-server';
|
|
99
|
-
endpoint?: {
|
|
100
|
-
graphql?: string;
|
|
101
|
-
healthCheck?: string;
|
|
102
|
-
};
|
|
103
|
-
playground?: boolean;
|
|
104
|
-
typedefs?: string[];
|
|
105
|
-
resolvers?: Array<IResolvers<any, any>>;
|
|
106
|
-
loader?: {
|
|
107
|
-
include?: RegExp;
|
|
108
|
-
exclude?: RegExp;
|
|
109
|
-
validate?: boolean;
|
|
110
|
-
};
|
|
111
|
-
codegen?: {
|
|
112
|
-
server?: CodegenServerConfig;
|
|
113
|
-
client?: CodegenClientConfig;
|
|
114
|
-
clientSDK?: GenericSdkConfig;
|
|
115
|
-
};
|
|
116
|
-
/** External GraphQL services to generate types and SDKs for */
|
|
117
|
-
externalServices?: ExternalGraphQLService[];
|
|
118
|
-
/** Apollo Federation configuration */
|
|
119
|
-
federation?: FederationConfig;
|
|
120
|
-
/** Server GraphQL directory path */
|
|
121
|
-
serverDir?: string;
|
|
122
|
-
/** Layer directories (populated by Nuxt module) */
|
|
123
|
-
layerDirectories?: string[];
|
|
124
|
-
layerServerDirs?: string[];
|
|
125
|
-
layerAppDirs?: string[];
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
export { CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, FederationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|