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

piral-urql

Package Overview
Dependencies
Maintainers
1
Versions
947
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

piral-urql - npm Package Compare versions

Comparing version 0.10.0-pre.846 to 0.10.0-pre.853

6

package.json
{
"name": "piral-urql",
"version": "0.10.0-pre.846",
"version": "0.10.0-pre.853",
"description": "Plugin for providing a GraphQL client in Piral.",

@@ -42,3 +42,3 @@ "keywords": [

"devDependencies": {
"piral-core": "^0.10.0-pre.846"
"piral-core": "^0.10.0-pre.853"
},

@@ -55,3 +55,3 @@ "peerDependencies": {

},
"gitHead": "bf161f59f5b0b218f7443a4cf61534edd2aef929"
"gitHead": "840155ef91a8f43f65ded5e18985ad25074bdc63"
}

@@ -27,4 +27,67 @@ [![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)

## Usage
> For authors of pilets
You can use the `query` function from the Pilet API to execute a GraphQL query against the defined GraphQL server.
Example use:
```ts
import { PiletApi } from '<name-of-piral-instance>';
export function setup(piral: PiletApi) {
const gql = `query {
myResource(id: "example") {
name
age
whatever
}
}`;
const promise = piral.query(gql).then(({ name, age, whatever }) => {});
}
```
You can use the `mutate` function from the Pilet API to run a GraphQL mutation against the defined GraphQL server.
Example use:
```ts
import { PiletApi } from '<name-of-piral-instance>';
export function setup(piral: PiletApi) {
const gql = `mutation {
changeMyResource(id: "example", name: "foo") {
name
age
whatever
}
}`;
const promise = piral.mutate(gql).then(({ name, age, whatever }) => {});
}
```
You can use the `subscribe` function from the Pilet API to create a GraphQL subscription to the defined GraphQL server.
Example use:
```ts
import { PiletApi } from '<name-of-piral-instance>';
export function setup(piral: PiletApi) {
const gql = `subscription {
onMyResourceChange(id: "example") {
name
age
whatever
}
}`;
const unsubscribe = piral.subscribe(gql, ({ name, age, whatever }) => {});
}
```
## Setup and Bootstrapping
> For Piral instance developers
The provided library only brings API extensions for pilets to a Piral instance.

@@ -31,0 +94,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