Skip to content

Commit e87bd01

Browse files
committed
typings update, and version
1 parent 3aa0c2f commit e87bd01

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

index.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import React, { StatelessComponent, ComponentClass, ClassicComponentClass } from "react";
2-
import Client from "./src/client";
2+
import compress from "./src/compress";
33

44
type IReactComponent<P = any> = StatelessComponent<P> | ComponentClass<P> | ClassicComponentClass<P>;
55

6+
class Client {
7+
constructor(options: any);
8+
runQuery(query: string, variables: any = null): any;
9+
getGraphqlQuery({ query: string, variables: any = null }): any;
10+
runMutation(mutation: string, variables: any = null): any;
11+
}
12+
declare function setDefaultClient(client: Client): void;
13+
14+
export { compress, Client, setDefaultClient };
15+
616
//options you can pass to the query decorator
717
export interface QueryOptions {
818
shouldQueryUpdate?: ({ prevProps: any, props: any, prevQuery: string, query: string, prevVariables: any, variables: any }) => boolean;
@@ -38,8 +48,8 @@ export type MutationProps = {
3848
//query decorator
3949
export function query(
4050
queryFn: (componentProps: any) => { query: string; variables: any },
41-
options: QueryOptions
51+
options?: QueryOptions
4252
): <T extends IReactComponent>(input: T) => T;
4353

4454
//mutation decorator
45-
export function mutation(mutation: string, options: MutationOptions): <T extends IReactComponent>(input: T) => T;
55+
export function mutation(mutation: string, options?: MutationOptions): <T extends IReactComponent>(input: T) => T;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "micro-graphql-react",
3-
"version": "0.1.1-beta1",
3+
"version": "0.1.1-beta2",
44
"description": "",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)