piral-urql
Advanced tools
Comparing version 0.8.0-pre.682 to 0.8.0-pre.683
{ | ||
"name": "piral-urql", | ||
"version": "0.8.0-pre.682", | ||
"version": "0.8.0-pre.683", | ||
"description": "Introduces the query, mutate, and subscribe API extensions for extending piral-core.", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"piral-core": "^0.8.0-pre.682" | ||
"piral-core": "^0.8.0-pre.683" | ||
}, | ||
@@ -55,3 +55,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "04da0183524adea0bae44c0f30f2b3ee1ce36e88" | ||
"gitHead": "2a3db9bdcf5523446ac735eb5f064be6afd600ba" | ||
} |
@@ -11,4 +11,42 @@ [![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io) | ||
## Setup and Bootstrapping | ||
The provided library only brings API extensions for pilets to a Piral instance. | ||
For the setup of the library itself you'll need to import `createGqlApi` from the `piral-urql` package. | ||
```tsx | ||
import { createGqlApi } from 'piral-urql'; | ||
``` | ||
The integration looks like: | ||
```tsx | ||
const instance = createInstance({ | ||
// important part | ||
extendApi: [createGqlApi()], | ||
// ... | ||
}); | ||
``` | ||
Via the options the correct client can be set up. Setting the `subscriptionUrl` to `false` will prevent using a subscription. | ||
For example: | ||
```tsx | ||
const client = setupGqlClient({ | ||
url: 'https://example.com/graphql', | ||
subscriptionUrl: false, | ||
lazy: true, | ||
}); | ||
const instance = createInstance({ | ||
// important part | ||
extendApi: [createGqlApi(client)], | ||
// ... | ||
}); | ||
``` | ||
## License | ||
Piral is released using the MIT license. For more information see the [license file](./LICENSE). |
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
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
25996
52