File tree 3 files changed +9
-3
lines changed
utils/plugins-helpers/src
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @graphql-codegen/cli ' : patch
3
+ ' @graphql-codegen/plugin-helpers ' : patch
4
+ ---
5
+
6
+ don't require plugins for for config if preset provides plugin. Instead the preset should throw if no plugins were provided.
Original file line number Diff line number Diff line change @@ -124,9 +124,9 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
124
124
}
125
125
126
126
for ( const filename of generateKeys ) {
127
- generates [ filename ] = normalizeOutputParam ( config . generates [ filename ] ) ;
127
+ const output = ( generates [ filename ] = normalizeOutputParam ( config . generates [ filename ] ) ) ;
128
128
129
- if ( generates [ filename ] . plugins . length === 0 ) {
129
+ if ( ! output . preset && ( ! output . plugins || output . plugins . length === 0 ) ) {
130
130
throw new DetailedError (
131
131
'Invalid Codegen Configuration!' ,
132
132
`
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export function isOutputConfigArray(type: any): type is Types.OutputConfig[] {
25
25
}
26
26
27
27
export function isConfiguredOutput ( type : any ) : type is Types . ConfiguredOutput {
28
- return typeof type === 'object' && type . plugins ;
28
+ return ( typeof type === 'object' && type . plugins ) || type . preset ;
29
29
}
30
30
31
31
export function normalizeOutputParam ( config : Types . OutputConfig | Types . ConfiguredOutput ) : Types . ConfiguredOutput {
You can’t perform that action at this time.
0 commit comments