File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @apollo/client " : patch
3+ ---
4+
5+ Create mechanism to add experimental features to Apollo Client
Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ export declare namespace ApolloClient {
132132 * queries.
133133 */
134134 incrementalHandler ?: Incremental . Handler < any > ;
135+
136+ experiments ?: ApolloClient . Experiment [ ] ;
135137 }
136138
137139 interface DevtoolsOptions {
@@ -610,6 +612,10 @@ export declare namespace ApolloClient {
610612 variables ?: TVariables ;
611613 }
612614 }
615+
616+ export interface Experiment {
617+ ( this : ApolloClient , options : ApolloClient . Options ) : void ;
618+ }
613619}
614620
615621/**
@@ -708,6 +714,7 @@ export class ApolloClient {
708714 dataMasking,
709715 link,
710716 incrementalHandler = new NotImplementedHandler ( ) ,
717+ experiments = [ ] ,
711718 } = options ;
712719
713720 this . link = link ;
@@ -759,6 +766,8 @@ export class ApolloClient {
759766 }
760767
761768 if ( this . devtoolsConfig . enabled ) this . connectToDevTools ( ) ;
769+
770+ experiments . forEach ( ( experiment ) => experiment . call ( this , options ) ) ;
762771 }
763772
764773 private connectToDevTools ( ) {
You can’t perform that action at this time.
0 commit comments