File tree Expand file tree Collapse file tree
packages/plugins/typescript/react-apollo/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphql-codegen/typescript-react-apollo ' : patch
3+ ---
4+
5+ fix: loosen defaultBaseOptions type
Original file line number Diff line number Diff line change @@ -266,8 +266,21 @@ export interface ReactApolloRawPluginConfig extends RawClientSideBasePluginConfi
266266 * ```
267267 */
268268 addDocBlocks ?: boolean ;
269-
270- defaultBaseOptions ?: { [ key : string ] : string } ;
269+ /**
270+ * @description Configure default mutation and query hook options.
271+ */
272+ defaultBaseOptions ?: ReactApolloPluginConfigDefaultBaseOptions ;
271273
272274 hooksSuffix ?: string ;
273275}
276+
277+ export interface ReactApolloPluginConfigDefaultBaseOptions {
278+ awaitRefetchQueries ?: boolean ;
279+ errorPolicy ?: string ;
280+ fetchPolicy ?: string ;
281+ ignoreResults ?: boolean ;
282+ notifyOnNetworkStatusChange ?: boolean ;
283+ returnPartialData ?: boolean ;
284+ ssr ?: boolean ;
285+ [ key : string ] : any ;
286+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
1010 LoadedFragment ,
1111 OMIT_TYPE ,
1212} from '@graphql-codegen/visitor-plugin-common' ;
13- import { ReactApolloRawPluginConfig } from './config.js' ;
13+ import { ReactApolloPluginConfigDefaultBaseOptions , ReactApolloRawPluginConfig } from './config.js' ;
1414
1515const APOLLO_CLIENT_3_UNIFIED_PACKAGE = `@apollo/client` ;
1616const GROUPED_APOLLO_CLIENT_3_IDENTIFIER = 'Apollo' ;
@@ -31,7 +31,7 @@ export interface ReactApolloPluginConfig extends ClientSideBasePluginConfig {
3131 withResultType : boolean ;
3232 withMutationOptionsType : boolean ;
3333 addDocBlocks : boolean ;
34- defaultBaseOptions : { [ key : string ] : string } ;
34+ defaultBaseOptions : ReactApolloPluginConfigDefaultBaseOptions ;
3535 hooksSuffix : string ;
3636}
3737
You can’t perform that action at this time.
0 commit comments