Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sprocketbot/gql-stores

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sprocketbot/gql-stores - npm Package Compare versions

Comparing version 0.1.0-beta.3 to 0.1.0-beta.4

types.js

12

index.d.ts

@@ -1,6 +0,6 @@

export { BaseStore } from "./BaseStore";
export { LiveQueryStore } from "./LiveQueryStore";
export { Mutation } from "./Mutation";
export { QueryStore } from "./QueryStore";
export * from "./types";
export { Client } from "@urql/core";
export { BaseStore } from "./BaseStore.js";
export { LiveQueryStore } from "./LiveQueryStore.js";
export { Mutation } from "./Mutation.js";
export { QueryStore } from "./QueryStore.js";
export * from "./types.js";
export { Client, gql } from "@urql/core";
// Reexport your entry components here
export {BaseStore} from "./BaseStore"
export {LiveQueryStore} from "./LiveQueryStore"
export {Mutation} from "./Mutation"
export {QueryStore} from "./QueryStore"
export * from "./types"
export {BaseStore} from "./BaseStore.js"
export {LiveQueryStore} from "./LiveQueryStore.js"
export {Mutation} from "./Mutation.js"
export {QueryStore} from "./QueryStore.js"
export * from "./types.js"
// Reexport client from urql
export {Client} from "@urql/core"
export {Client, gql} from "@urql/core"
{
"name": "@sprocketbot/gql-stores",
"version": "0.1.0-beta.3",
"version": "0.1.0-beta.4",
"description": "Wrapper for @urql/core that presents a store-based API instead of a context-based API",

@@ -34,4 +34,5 @@ "devDependencies": {

"./QueryStore": "./QueryStore.js",
".": "./index.js"
".": "./index.js",
"./types": "./types.js"
}
}

@@ -1,30 +0,20 @@

import type {CombinedError} from "@urql/core";
export type BaseVariables = {[prop: string]: string | number | boolean | BaseVariables};
import type { CombinedError } from "@urql/core";
export type BaseVariables = {
[prop: string]: string | number | boolean | BaseVariables;
};
export type QueryStoreValue<Value, Variables> = // State specific types
(
| {
// Error state; data may exist
success: false;
errors: CombinedError;
}
| {
// Success state; data must exist
success: true;
data: Value;
}
| {
// Fetching state
fetching: true;
}
) & {
success?: boolean;
// Leave data & fetching as optional & undefined to help make types more ergonomic
fetching?: boolean;
// If refetching; previous value will continue to be provided.
data?: Value;
// Errors may always exist
errors?: CombinedError;
// Keep variables in the value as well to ensure that they can be displayed
variables: Variables
};
({
success: false;
errors: CombinedError;
} | {
success: true;
data: Value;
} | {
fetching: true;
}) & {
success?: boolean;
fetching?: boolean;
data?: Value;
errors?: CombinedError;
variables: Variables;
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc