vite-plugin-vue-gql
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "vite-plugin-vue-gql", | ||
"description": "Vue SFC GraphQL Block", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "module": "dist/index.mjs", |
@@ -162,2 +162,30 @@ <p align="center"> | ||
**Subscriptions** | ||
```html | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { useSubscription } from 'vql' | ||
const isPaused = ref(false) | ||
const handleSubscription = (messages = [], response) => { | ||
return [response.newMessages, ...messages] | ||
} | ||
const { data } = useSubscription({ from: 'Eren' }, { pause: isPaused }, handleSubscription) | ||
</script> | ||
<template>...</template> | ||
<gql mutation> | ||
subscription MessageSub($from: String!) { | ||
newMessages(from: $from) { | ||
id | ||
from | ||
text | ||
} | ||
} | ||
</gql> | ||
``` | ||
## Roadmap | ||
@@ -164,0 +192,0 @@ - [ ] Add support for fragments |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2428428
196
68823