Skip to content

Commit 0c77a7e

Browse files
committed
🐛 Allow string[] and number[] on graphql variables
1 parent a5ccdb2 commit 0c77a7e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
},
3131
"license": "MIT",
3232
"name": "@crystallize/js-api-client",
33-
"version": "0.2.2"
33+
"version": "0.2.3"
3434
}

src/core/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export interface ClientConfiguration {
66
accessTokenSecret?: string;
77
}
88

9-
type variablesType = { [key: string]: string | number };
9+
type VariablesType = { [key: string]: string | number | string[] | number[] };
1010

1111
type ApiCaller<T, E, Z> = (
1212
query: string,
13-
variables?: variablesType
13+
variables?: VariablesType
1414
) => Promise<T | E | Z>;
1515

1616
export interface ClientInterface {
@@ -25,7 +25,7 @@ async function post<T, E, Z>(
2525
path: string,
2626
config: ClientConfiguration,
2727
query: string,
28-
variables?: variablesType,
28+
variables?: VariablesType,
2929
init?: RequestInit
3030
): Promise<T | E | Z> {
3131
try {
@@ -58,7 +58,7 @@ export function createClient(configuration: ClientConfiguration) {
5858
function createApiCaller(uri: string): ApiCaller<any, any, string> {
5959
return function callApi<T, E, Z>(
6060
query: string,
61-
variables?: variablesType
61+
variables?: VariablesType
6262
): Promise<T | E | Z> {
6363
return post<T, E, Z>(uri, configuration, query, variables);
6464
};

0 commit comments

Comments
 (0)