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

@graphql-live/client

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-live/client - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

package.json
{
"name": "@graphql-live/client",
"version": "0.1.8",
"version": "0.1.9",
"description": "The client part of the GraphQLive package",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# @graphql-live/client
> **⚠ WARNING: Still under development.**
Very tiny library to send **live queries** to a compatible GraphQL server ([`@graphql-live/server`](https://www.npmjs.com/package/@graphql-live/server)) using the `@live` directive and automatically get updates when fresh data is available. Under the hood, the client uses Socket.IO to communicate and receives JSON patches to perform surgical updates of previous results _(side note : you don't have to think about it)_, thus optimizing bandwidth usage.
Of course, it also supports standard queries and mutations (subscriptions might come in the futur).
## Install

@@ -116,15 +120,23 @@

url: "http://localhost:8080",
exchanges: [
dedupExchange,
cacheExchange(),
liveExchange({
url: "http://localhost:8080",
context() {
return auth().currentUser.token;
}
})
]
context() {
return auth().currentUser.token;
}
});
```
_Note: `createClient`, `LiveLink` and `liveExchange` all accept the same options._
### Custom path
You can pass any valid Socket.IO client options to the live query client, including a custom `path` :
```javascript
const client = createClient({
url: "http://localhost:8080",
socketOptions: {
path: "/api"
}
});
```
## API

@@ -131,0 +143,0 @@

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