@paypal/sdk-client
Advanced tools
Comparing version
{ | ||
"name": "@paypal/sdk-client", | ||
"version": "4.0.156", | ||
"version": "4.0.158", | ||
"description": "Shared config between PayPal/Braintree.", | ||
@@ -65,3 +65,3 @@ "main": "index.js", | ||
"esdoc-standard-plugin": "1.0.0", | ||
"flow-bin": "0.135.0", | ||
"flow-bin": "0.155.0", | ||
"grumbler-scripts": "^3", | ||
@@ -68,0 +68,0 @@ "mocha": "4.1.0", |
/* @flow */ | ||
// $FlowFixMe[toplevel-library-import] | ||
import { ENV, COMPONENTS, PROTOCOL } from '@paypal/sdk-constants/src'; | ||
// $FlowFixMe[toplevel-library-import] | ||
import type { FundingEligibilityType } from './types'; | ||
@@ -28,2 +30,3 @@ | ||
// $FlowFixMe[value-as-type] | ||
declare var __FUNDING_ELIGIBILITY__ : FundingEligibilityType; |
@@ -64,3 +64,8 @@ /* @flow */ | ||
export function callGraphQL<T, V>({ query, variables = {}, headers = {} } : {| query : string, variables : V, headers? : { [string] : string } |}) : ZalgoPromise<T> { | ||
function getDefaultVariables<V>() : V { | ||
// $FlowFixMe[incompatible-return] | ||
return {}; | ||
} | ||
export function callGraphQL<T, V>({ query, variables = getDefaultVariables(), headers = {} } : {| query : string, variables : V, headers? : { [string] : string } |}) : ZalgoPromise<T> { | ||
return request({ | ||
@@ -67,0 +72,0 @@ url: buildPayPalUrl(GRAPHQL_URI), |
@@ -61,3 +61,3 @@ /* @flow */ | ||
export const getSDKQueryParam : GetSDKQueryParam = (name, def) => { | ||
export const getSDKQueryParam : GetSDKQueryParam = <T>(name : string, def : T) => { | ||
// $FlowFixMe | ||
@@ -64,0 +64,0 @@ return getSDKQueryParams()[name] || def; |
78964
0.3%1561
0.45%