From 3d0b221c14cdd098f1778e299b4c02238fe81c26 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 7 Oct 2024 18:39:45 -0400 Subject: [PATCH] the rest? --- .gitignore | 1 + .../ApolloClient__Cache_InMemory_Policies.res | 41 +++--- ...t__Cache_InMemory_Policies_FieldPolicy.res | 18 +-- .../core/ApolloClient__Core_ApolloClient.res | 22 ++-- .../ApolloClient__Core_WatchQueryOptions.res | 85 ++++++------ .../ApolloClient__Link_Retry_RetryLink.res | 16 +-- ...lloClient__React_Hooks_UseSubscription.res | 13 +- .../react/types/ApolloClient__React_Types.res | 122 +++++++++--------- ...ApolloClient__SubscriptionsTransportWs.res | 57 ++++---- 9 files changed, 188 insertions(+), 187 deletions(-) diff --git a/.gitignore b/.gitignore index 2ba7c1f..cb55cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ yarn-error.log .vscode/ lib/ node_modules/ +.yarn/install-state.gz \ No newline at end of file diff --git a/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies.res b/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies.res index 768d6fe..e93a2bf 100644 --- a/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies.res +++ b/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies.res @@ -51,11 +51,11 @@ module TypePolicy = { // }; // }; type t = { - keyFields: option, - queryType: option, - mutationType: option, - subscriptionType: option, - fields: option>, + keyFields?: KeyArgs.Js_.t, + queryType?: bool, + mutationType?: bool, + subscriptionType?: bool, + fields?: Js.Dict.t, } } @@ -71,19 +71,19 @@ module TypePolicy = { type t_fields = array<(fieldKey, t_field)> type t = { - keyFields: option, - queryType: option, - mutationType: option, - subscriptionType: option, - fields: option, + keyFields?: KeyArgs.t, + queryType?: bool, + mutationType?: bool, + subscriptionType?: bool, + fields?: t_fields, } let toJs: (. t) => Js_.t = (. t) => { - keyFields: t.keyFields->Belt.Option.map(KeyArgs.toJs), - queryType: t.queryType, - mutationType: t.mutationType, - subscriptionType: t.subscriptionType, - fields: t.fields->Belt.Option.map(fields => + keyFields: ?t.keyFields->Belt.Option.map(KeyArgs.toJs), + queryType: ?t.queryType, + mutationType: ?t.mutationType, + subscriptionType: ?t.subscriptionType, + fields: ?t.fields->Belt.Option.map(fields => fields ->Belt.Array.map(((fieldKey, t_field)) => ( fieldKey, @@ -104,6 +104,7 @@ module TypePolicy = { ), } + @deprecated("Construct the record directly instead") let make: ( ~fields: t_fields=?, ~keyFields: KeyArgs.t=?, @@ -112,11 +113,11 @@ module TypePolicy = { ~subscriptionType: bool=?, unit, ) => t = (~fields=?, ~keyFields=?, ~mutationType=?, ~queryType=?, ~subscriptionType=?, ()) => { - fields, - keyFields, - mutationType, - queryType, - subscriptionType, + ?fields, + ?keyFields, + ?mutationType, + ?queryType, + ?subscriptionType, } } diff --git a/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies_FieldPolicy.res b/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies_FieldPolicy.res index 5fe0bde..3668043 100644 --- a/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies_FieldPolicy.res +++ b/src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies_FieldPolicy.res @@ -210,9 +210,9 @@ module FieldPolicy_KeyArgs = { module FieldPolicy = { type t<'existing> = { - keyArgs: option, - read: option>, - merge: option>, + keyArgs?: FieldPolicy_KeyArgs.t, + read?: FieldReadFunction.t<'existing>, + merge?: FieldMerge.t<'existing>, } module Js_ = { @@ -222,15 +222,15 @@ module FieldPolicy = { // merge?: FieldMergeFunction | boolean; // }; type t<'existing> = { - keyArgs: option, - read: option>, - merge: option>, + keyArgs?: FieldPolicy_KeyArgs.Js_.t, + read?: FieldReadFunction.Js_.t<'existing>, + merge?: FieldMerge.Js_.t<'existing>, } } let toJs: t<'existing> => Js_.t<'existing> = t => { - keyArgs: t.keyArgs->Belt.Option.map(FieldPolicy_KeyArgs.toJs), - read: t.read->Belt.Option.map(FieldReadFunction.toJs), - merge: t.merge->Belt.Option.map(FieldMerge.toJs), + keyArgs: ?t.keyArgs->Belt.Option.map(FieldPolicy_KeyArgs.toJs), + read: ?t.read->Belt.Option.map(FieldReadFunction.toJs), + merge: ?t.merge->Belt.Option.map(FieldMerge.toJs), } } diff --git a/src/@apollo/client/core/ApolloClient__Core_ApolloClient.res b/src/@apollo/client/core/ApolloClient__Core_ApolloClient.res index 6bb12ad..0ae9516 100644 --- a/src/@apollo/client/core/ApolloClient__Core_ApolloClient.res +++ b/src/@apollo/client/core/ApolloClient__Core_ApolloClient.res @@ -671,15 +671,15 @@ let make: ( jsClient, ~options=MutationOptions.toJs( { - awaitRefetchQueries, - context, - errorPolicy, - fetchPolicy, + ?awaitRefetchQueries, + ?context, + ?errorPolicy, + ?fetchPolicy, mutation: Operation.query, - optimisticResponse, - updateQueries, - refetchQueries, - update, + ?optimisticResponse, + ?updateQueries, + ?refetchQueries, + ?update, variables, }, ~mapJsVariables, @@ -858,11 +858,11 @@ let make: ( jsClient, ~options=SubscriptionOptions.toJs( { - fetchPolicy, + ?fetchPolicy, query: Operation.query, variables, - errorPolicy, - context, + ?errorPolicy, + ?context, }, ~mapJsVariables, ~serializeVariables=Operation.serializeVariables, diff --git a/src/@apollo/client/core/ApolloClient__Core_WatchQueryOptions.res b/src/@apollo/client/core/ApolloClient__Core_WatchQueryOptions.res index cf54df3..962df72 100644 --- a/src/@apollo/client/core/ApolloClient__Core_WatchQueryOptions.res +++ b/src/@apollo/client/core/ApolloClient__Core_WatchQueryOptions.res @@ -231,20 +231,19 @@ module SubscribeToMoreOptions = { document: Graphql.documentNode, // We don't allow optional variables because it's not typesafe variables: 'subscriptionVariables, - updateQuery: option< + updateQuery?: UpdateQueryFn.Js_.t<'jsQueryData, 'subscriptionVariables, 'jsSubscriptionData>, - >, - onError: option unit>, - context: option, + onError?: Js.Exn.t => unit, + context?: Js.Json.t, } } type t<'queryData, 'subscriptionVariables, 'subscriptionData> = { document: Graphql.documentNode, variables: 'subscriptionVariables, - updateQuery: option>, - onError: option unit>, - context: option, + updateQuery?: UpdateQueryFn.t<'queryData, 'subscriptionVariables, 'subscriptionData>, + onError?: Js.Exn.t => unit, + context?: Js.Json.t, } let toJs: ( @@ -262,7 +261,7 @@ module SubscribeToMoreOptions = { ) => { document: t.document, variables: t.variables, - updateQuery: t.updateQuery->Belt.Option.map( + updateQuery: ?t.updateQuery->Belt.Option.map( UpdateQueryFn.toJs( ~onParseError=onUpdateQueryParseError, ~querySafeParse, @@ -270,8 +269,8 @@ module SubscribeToMoreOptions = { ~subscriptionSafeParse, ), ), - onError: t.onError, - context: t.context, + onError: ?t.onError, + context: ?t.context, } } @@ -288,18 +287,18 @@ module SubscriptionOptions = { query: Graphql.documentNode, // We don't allow optional variables because it's not typesafe variables: 'jsVariables, - fetchPolicy: option, - errorPolicy: option, - context: option, + fetchPolicy?: FetchPolicy.Js_.t, + errorPolicy?: ErrorPolicy.Js_.t, + context?: Js.Json.t, } } type t<'variables> = { query: Graphql.documentNode, variables: 'variables, - fetchPolicy: option, - errorPolicy: option, - context: option, + fetchPolicy?: FetchPolicy.t, + errorPolicy?: ErrorPolicy.t, + context?: Js.Json.t, } let toJs: ( @@ -309,9 +308,9 @@ module SubscriptionOptions = { ) => Js_.t<'jsVariables> = (t, ~mapJsVariables, ~serializeVariables) => { query: t.query, variables: t.variables->serializeVariables->mapJsVariables, - fetchPolicy: t.fetchPolicy->Belt.Option.map(FetchPolicy.toJs), - errorPolicy: t.errorPolicy->Belt.Option.map(ErrorPolicy.toJs), - context: t.context, + fetchPolicy: ?t.fetchPolicy->Belt.Option.map(FetchPolicy.toJs), + errorPolicy: ?t.errorPolicy->Belt.Option.map(ErrorPolicy.toJs), + context: ?t.context, } } @@ -371,31 +370,31 @@ module MutationOptions = { // } type t<'jsData, 'jsVariables> = { mutation: Graphql.documentNode, - context: option, - fetchPolicy: option, + context?: Js.Json.t, + fetchPolicy?: FetchPolicy__noCacheExtracted.Js_.t, // ...extends MutationBaseOption, - awaitRefetchQueries: option, - errorPolicy: option, - optimisticResponse: option<(. 'jsVariables) => 'jsData>, - update: option>, - updateQueries: option>, - refetchQueries: option, + awaitRefetchQueries?: bool, + errorPolicy?: ErrorPolicy.Js_.t, + optimisticResponse?: (. 'jsVariables) => 'jsData, + update?: MutationUpdaterFn.Js_.t<'jsData>, + updateQueries?: MutationQueryReducersMap.Js_.t<'jsData>, + refetchQueries?: RefetchQueryDescription.Js_.t, // We don't allow optional variables because it's not typesafe variables: 'jsVariables, } } type t<'data, 'variables, 'jsVariables> = { - context: option, - fetchPolicy: option, + context?: Js.Json.t, + fetchPolicy?: FetchPolicy__noCacheExtracted.t, mutation: Graphql.documentNode, // ...extends MutationBaseOptions, - awaitRefetchQueries: option, - errorPolicy: option, - optimisticResponse: option<'jsVariables => 'data>, - refetchQueries: option, - update: option>, - updateQueries: option>, + awaitRefetchQueries?: bool, + errorPolicy?: ErrorPolicy.t, + optimisticResponse?: 'jsVariables => 'data, + refetchQueries?: RefetchQueryDescription.t, + update?: MutationUpdaterFn.t<'data>, + updateQueries?: MutationQueryReducersMap.t<'data>, variables: 'variables, } @@ -412,17 +411,17 @@ module MutationOptions = { ~serialize, ~serializeVariables, ) => { - awaitRefetchQueries: t.awaitRefetchQueries, - context: t.context, - errorPolicy: t.errorPolicy->Belt.Option.map(ErrorPolicy.toJs), - fetchPolicy: t.fetchPolicy->Belt.Option.map(FetchPolicy__noCacheExtracted.toJs), + awaitRefetchQueries: ?t.awaitRefetchQueries, + context: ?t.context, + errorPolicy: ?t.errorPolicy->Belt.Option.map(ErrorPolicy.toJs), + fetchPolicy: ?t.fetchPolicy->Belt.Option.map(FetchPolicy__noCacheExtracted.toJs), mutation: t.mutation, - optimisticResponse: t.optimisticResponse->Belt.Option.map(optimisticResponse => + optimisticResponse: ?t.optimisticResponse->Belt.Option.map(optimisticResponse => (. variables) => optimisticResponse(variables)->serialize ), - refetchQueries: t.refetchQueries->Belt.Option.map(RefetchQueryDescription.toJs), - update: t.update->Belt.Option.map(MutationUpdaterFn.toJs(~safeParse)), - updateQueries: t.updateQueries->Belt.Option.map(MutationQueryReducersMap.toJs(~safeParse)), + refetchQueries: ?t.refetchQueries->Belt.Option.map(RefetchQueryDescription.toJs), + update: ?t.update->Belt.Option.map(MutationUpdaterFn.toJs(~safeParse)), + updateQueries: ?t.updateQueries->Belt.Option.map(MutationQueryReducersMap.toJs(~safeParse)), variables: t.variables->serializeVariables->mapJsVariables, } } diff --git a/src/@apollo/client/link/retry/ApolloClient__Link_Retry_RetryLink.res b/src/@apollo/client/link/retry/ApolloClient__Link_Retry_RetryLink.res index 9f90d14..12323e9 100644 --- a/src/@apollo/client/link/retry/ApolloClient__Link_Retry_RetryLink.res +++ b/src/@apollo/client/link/retry/ApolloClient__Link_Retry_RetryLink.res @@ -35,8 +35,8 @@ module Options = { // } // } type t = { - delay: option, - attempts: option, + delay?: T_delayUnion.t, + attempts?: T_attemptsUnion.t, } } @@ -44,12 +44,12 @@ module Options = { type t_attempts = RetryFunctionOptions(RetryFunctionOptions.t) | RetryFunction(RetryFunction.t) type t = { - delay: option, - attempts: option, + delay?: t_delay, + attempts?: t_attempts, } let toJs: t => Js_.t = t => { - delay: t.delay->Belt.Option.map(delay => + delay: ?t.delay->Belt.Option.map(delay => switch delay { | DelayFunctionOptions(delayFunctionOptions) => Js_.T_delayUnion.delayFunctionOptions(delayFunctionOptions) @@ -57,7 +57,7 @@ module Options = { Js_.T_delayUnion.delayFunction(delayFunction->DelayFunction.toJs) } ), - attempts: t.attempts->Belt.Option.map(attempts => + attempts: ?t.attempts->Belt.Option.map(attempts => switch attempts { | RetryFunctionOptions(retryFunctionOptions) => Js_.T_attemptsUnion.retryFunctionOptions(retryFunctionOptions->RetryFunctionOptions.toJs) @@ -82,7 +82,7 @@ module Js_ = { let make = (~attempts=?, ~delay=?, ()) => Js_.make( Options.toJs({ - attempts: attempts, - delay: delay, + attempts: ?attempts, + delay: ?delay, }), ) diff --git a/src/@apollo/client/react/hooks/ApolloClient__React_Hooks_UseSubscription.res b/src/@apollo/client/react/hooks/ApolloClient__React_Hooks_UseSubscription.res index c3e56d7..15afbcf 100644 --- a/src/@apollo/client/react/hooks/ApolloClient__React_Hooks_UseSubscription.res +++ b/src/@apollo/client/react/hooks/ApolloClient__React_Hooks_UseSubscription.res @@ -72,13 +72,12 @@ let useSubscription: Operation.query, SubscriptionHookOptions.toJs( { - client: client, - fetchPolicy: fetchPolicy, - onSubscriptionData: onSubscriptionData, - onSubscriptionComplete: onSubscriptionComplete, - subscription: None, - shouldResubscribe: shouldResubscribe, - skip: skip, + client: ?client, + fetchPolicy: ?fetchPolicy, + onSubscriptionData: ?onSubscriptionData, + onSubscriptionComplete: ?onSubscriptionComplete, + shouldResubscribe: ?shouldResubscribe, + skip: ?skip, variables: variables, }, ~mapJsVariables, diff --git a/src/@apollo/client/react/types/ApolloClient__React_Types.res b/src/@apollo/client/react/types/ApolloClient__React_Types.res index 4c92dc4..6e852f7 100644 --- a/src/@apollo/client/react/types/ApolloClient__React_Types.res +++ b/src/@apollo/client/react/types/ApolloClient__React_Types.res @@ -465,11 +465,11 @@ module QueryResult = { { document: Operation.query, variables, - updateQuery, - onError: onError->Belt.Option.map((onError, error) => + ?updateQuery, + onError: ?onError->Belt.Option.map((onError, error) => onError(SubscriptionError(error)) ), - context, + ?context, }, ~onUpdateQueryParseError=parseError => switch onError { @@ -866,23 +866,23 @@ module MutationFunctionOptions = { type t<'jsData, 'jsVariables> = { // We don't allow optional variables because it's not typesafe variables: 'jsVariables, - optimisticResponse: option<(. 'jsVariables) => 'jsData>, - refetchQueries: option, - awaitRefetchQueries: option, - update: option>, - context: option, // actual: option(Context) - fetchPolicy: option, + optimisticResponse?: (. 'jsVariables) => 'jsData, + refetchQueries?: RefetchQueryDescription.Js_.t, + awaitRefetchQueries?: bool, + update?: MutationUpdaterFn.Js_.t<'jsData>, + context?: Js.Json.t, // actual: option + fetchPolicy?: WatchQueryFetchPolicy.Js_.t, } } type t<'data, 'variables, 'jsVariables> = { variables: 'variables, - optimisticResponse: option<'jsVariables => 'data>, - refetchQueries: option, - awaitRefetchQueries: option, - update: option>, - context: option, // actual: option(Context) - fetchPolicy: option, + optimisticResponse?: 'jsVariables => 'data, + refetchQueries?: RefetchQueryDescription.t, + awaitRefetchQueries?: bool, + update?: MutationUpdaterFn.t<'data>, + context?: Js.Json.t, // actual: option(Context) + fetchPolicy?: WatchQueryFetchPolicy.t, } let toJs: ( @@ -899,14 +899,14 @@ module MutationFunctionOptions = { ~serializeVariables, ) => { variables: t.variables->serializeVariables->mapJsVariables, - optimisticResponse: t.optimisticResponse->Belt.Option.map(optimisticResponse => + optimisticResponse: ?t.optimisticResponse->Belt.Option.map(optimisticResponse => (. variables) => optimisticResponse(variables)->serialize ), - refetchQueries: t.refetchQueries->Belt.Option.map(RefetchQueryDescription.toJs), - awaitRefetchQueries: t.awaitRefetchQueries, - update: t.update->Belt.Option.map(MutationUpdaterFn.toJs(~safeParse)), - context: t.context, - fetchPolicy: t.fetchPolicy->Belt.Option.map(WatchQueryFetchPolicy.toJs), + refetchQueries: ?t.refetchQueries->Belt.Option.map(RefetchQueryDescription.toJs), + awaitRefetchQueries: ?t.awaitRefetchQueries, + update: ?t.update->Belt.Option.map(MutationUpdaterFn.toJs(~safeParse)), + context: ?t.context, + fetchPolicy: ?t.fetchPolicy->Belt.Option.map(WatchQueryFetchPolicy.toJs), } } @@ -963,12 +963,12 @@ module MutationTuple = { MutationFunctionOptions.toJs( { variables, - optimisticResponse, - refetchQueries, - awaitRefetchQueries, - update, - context, - fetchPolicy, + ?optimisticResponse, + ?refetchQueries, + ?awaitRefetchQueries, + ?update, + ?context, + ?fetchPolicy, }, ~mapJsVariables, ~safeParse, @@ -1040,12 +1040,12 @@ module MutationTuple__noVariables = { MutationFunctionOptions.toJs( { variables, - optimisticResponse, - refetchQueries, - awaitRefetchQueries, - update, - context, - fetchPolicy, + ?optimisticResponse, + ?refetchQueries, + ?awaitRefetchQueries, + ?update, + ?context, + ?fetchPolicy, }, ~mapJsVariables, ~safeParse, @@ -1143,36 +1143,36 @@ module BaseSubscriptionOptions = { // onSubscriptionComplete?: () => void; // } type rec t<'jsData, 'jsVariables> = { - variables: option<'jsVariables>, - fetchPolicy: option, - shouldResubscribe: option<(. t<'jsData, 'jsVariables>) => bool>, - client: option, - skip: option, - onSubscriptionData: option<(. OnSubscriptionDataOptions.Js_.t<'jsData>) => unit>, - onSubscriptionComplete: option unit>, + variables?: 'jsVariables, + fetchPolicy?: FetchPolicy.t, + shouldResubscribe?: (. t<'jsData, 'jsVariables>) => bool, + client?: ApolloClient.t, + skip?: bool, + onSubscriptionData?: (. OnSubscriptionDataOptions.Js_.t<'jsData>) => unit, + onSubscriptionComplete?: unit => unit, } } type rec t<'data, 'jsVariables> = { - variables: option<'jsVariables>, - fetchPolicy: option, - shouldResubscribe: option => bool>, - client: option, - skip: option, - onSubscriptionData: option => unit>, - onSubscriptionComplete: option unit>, + variables?: 'jsVariables, + fetchPolicy?: FetchPolicy.t, + shouldResubscribe?: t<'data, 'jsVariables> => bool, + client?: ApolloClient.t, + skip?: bool, + onSubscriptionData?: OnSubscriptionDataOptions.t<'data> => unit, + onSubscriptionComplete?: unit => unit, } let fromJs: Js_.t<'jsData, 'jsVariables> => t<'data, 'jsVariables> = js => { - variables: js.variables, - fetchPolicy: js.fetchPolicy, + variables: ?js.variables, + fetchPolicy: ?js.fetchPolicy, // shouldResubscribe: what to do here? - shouldResubscribe: Obj.magic(js.shouldResubscribe), - client: js.client, - skip: js.skip, + shouldResubscribe: ?Obj.magic(js.shouldResubscribe), + client: ?js.client, + skip: ?js.skip, // onSubscriptionData: what to do here? - onSubscriptionData: Obj.magic(js.onSubscriptionData), - onSubscriptionComplete: js.onSubscriptionComplete, + onSubscriptionData: ?Obj.magic(js.onSubscriptionData), + onSubscriptionComplete: ?js.onSubscriptionComplete, } } @@ -1196,14 +1196,14 @@ module SubscriptionHookOptions = { } type t<'data, 'variables, 'jsVariables> = { - subscription: option, + subscription?: Graphql.documentNode, variables: 'variables, - fetchPolicy: option, - shouldResubscribe: option => bool>, - client: option, - skip: option, - onSubscriptionData: option => unit>, - onSubscriptionComplete: option unit>, + fetchPolicy?: FetchPolicy.t, + shouldResubscribe?: BaseSubscriptionOptions.t<'data, 'jsVariables> => bool, + client?: ApolloClient.t, + skip?: bool, + onSubscriptionData?: OnSubscriptionDataOptions.t<'data> => unit, + onSubscriptionComplete?: unit => unit, } let toJs: ( diff --git a/src/subscriptions-transport-ws/ApolloClient__SubscriptionsTransportWs.res b/src/subscriptions-transport-ws/ApolloClient__SubscriptionsTransportWs.res index a059733..7629726 100644 --- a/src/subscriptions-transport-ws/ApolloClient__SubscriptionsTransportWs.res +++ b/src/subscriptions-transport-ws/ApolloClient__SubscriptionsTransportWs.res @@ -84,38 +84,39 @@ module ClientOptions = { // inactivityTimeout?: number; // } type t = { - connectionParams: option, - timeout: option, - reconnect: option, - reconnectionAttempts: option, - connectionCallback: option<(~error: array, ~result: option) => unit>, + connectionParams?: ConnectionParamsOptions.Js_.t, + timeout?: int, + reconnect?: bool, + reconnectionAttempts?: int, + connectionCallback?: (~error: array, ~result: option) => unit, @as("lazy") - lazy_: option, - inactivityTimeout: option, + lazy_?: bool, + inactivityTimeout?: int, } } type t = { - connectionParams: option, - timeout: option, - reconnect: option, - reconnectionAttempts: option, - connectionCallback: option<(~error: array, ~result: option) => unit>, + connectionParams?: ConnectionParamsOptions.t, + timeout?: int, + reconnect?: bool, + reconnectionAttempts?: int, + connectionCallback?: (~error: array, ~result: option) => unit, @as("lazy") - lazy_: option, - inactivityTimeout: option, + lazy_?: bool, + inactivityTimeout?: int, } let toJs: t => Js_.t = t => { - connectionParams: t.connectionParams->Belt.Option.map(ConnectionParamsOptions.toJs), - timeout: t.timeout, - reconnect: t.reconnect, - reconnectionAttempts: t.reconnectionAttempts, - connectionCallback: t.connectionCallback, - lazy_: t.lazy_, - inactivityTimeout: t.inactivityTimeout, + connectionParams: ?t.connectionParams->Belt.Option.map(ConnectionParamsOptions.toJs), + timeout: ?t.timeout, + reconnect: ?t.reconnect, + reconnectionAttempts: ?t.reconnectionAttempts, + connectionCallback: ?t.connectionCallback, + lazy_: ?t.lazy_, + inactivityTimeout: ?t.inactivityTimeout, } + @deprecated("Construct the record directly instead") let make = ( ~connectionParams=?, ~timeout=?, @@ -126,13 +127,13 @@ module ClientOptions = { ~inactivityTimeout=?, (), ): t => { - connectionParams: connectionParams, - timeout: timeout, - reconnect: reconnect, - reconnectionAttempts: reconnectionAttempts, - connectionCallback: connectionCallback, - lazy_: lazy_, - inactivityTimeout: inactivityTimeout, + connectionParams: ?connectionParams, + timeout: ?timeout, + reconnect: ?reconnect, + reconnectionAttempts: ?reconnectionAttempts, + connectionCallback: ?connectionCallback, + lazy_: ?lazy_, + inactivityTimeout: ?inactivityTimeout, } }