stook-graphql
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -1,4 +0,8 @@ | ||
export * from './GlobalStore'; | ||
export * from './useStore'; | ||
export * from './mutate'; | ||
export { query } from './query'; | ||
export { useQuery } from './use-query'; | ||
export { useMutate } from './use-mutate'; | ||
export { useSubscribe } from './use-subscribe'; | ||
export { fromSubscription } from './from-subscription'; | ||
export * from './config'; | ||
export * from './types'; | ||
export * from './fetcher'; |
@@ -5,5 +5,5 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./stook.cjs.production.min.js') | ||
module.exports = require('./stook-graphql.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./stook.cjs.development.js') | ||
module.exports = require('./stook-graphql.cjs.development.js') | ||
} |
@@ -1,2 +0,60 @@ | ||
export declare type Action<S> = S | ((prevState: S) => S) | ((prevState: S) => void); | ||
export declare type Trigger<A> = (value: A) => void; | ||
export interface Variables { | ||
[key: string]: any; | ||
} | ||
export declare type Refetch = <T>(options?: Options) => Promise<T>; | ||
export declare type Deps = ReadonlyArray<any>; | ||
export interface Options<T = any> { | ||
name?: string; | ||
variables?: Variables; | ||
deps?: Deps; | ||
headers?: HeadersInit; | ||
data?: T; | ||
onChange?(result: Result<T>): any; | ||
} | ||
export declare type Mutate = (variables: Variables, options?: Options) => any; | ||
export interface FetcherItem<T = any> { | ||
refetch: Refetch; | ||
result: Result<T>; | ||
} | ||
export interface Fetcher<T = any> { | ||
[key: string]: FetcherItem<T>; | ||
} | ||
export interface Result<T = any> { | ||
loading: boolean; | ||
data: T; | ||
error: any; | ||
} | ||
export interface QueryResult<T> extends Result<T> { | ||
refetch: Refetch; | ||
} | ||
export interface MutateResult<T> extends Result<T> { | ||
} | ||
export interface SubscribeResult<T> extends Result<T> { | ||
} | ||
export declare type RequestInterceptor = (config: Options) => any; | ||
export declare type RequestErrorInterceptor = (config: any) => any; | ||
export declare type ResponseInterceptor = (error: any) => any; | ||
export declare type ResponseErrorInterceptor = (error: any) => any; | ||
export interface Interceptor { | ||
requests?: RequestInterceptor[]; | ||
requestErrors?: RequestErrorInterceptor[]; | ||
responses?: ResponseInterceptor[]; | ||
responseErrors?: ResponseErrorInterceptor[]; | ||
} | ||
export interface GraphqlConfig { | ||
endpoint: string; | ||
subscriptionsEndpoint?: string; | ||
interceptor?: Interceptor; | ||
headers?: HeadersInit; | ||
} | ||
export interface SubscriptionOption { | ||
variables?: Object; | ||
operationName?: string; | ||
initialQuery?: { | ||
query: string; | ||
variables?: Variables; | ||
}; | ||
} | ||
export interface FromSubscriptionOption { | ||
variables?: Object; | ||
} |
{ | ||
"name": "stook-graphql", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"license": "MIT", | ||
@@ -53,6 +53,6 @@ "author": "forsigner", | ||
"graphql-tag": "^2.10.1", | ||
"stook": "^0.0.1", | ||
"stook": "^0.1.0", | ||
"subscriptions-transport-ws": "^0.9.16" | ||
}, | ||
"gitHead": "25237cb063363b6ec35c03dfba15eb201fd31ed8" | ||
"gitHead": "6f289d6fd6bc14bda198bce378df7138eefe2ed3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
149788
19
955
1
+ Addedfast-deep-equal@2.0.1(transitive)
+ Addedstook@0.1.3(transitive)
- Removedstook@0.0.1(transitive)
Updatedstook@^0.1.0