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

vite-plugin-vue-gql

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-vue-gql - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

client.d.ts

@@ -6,4 +6,6 @@ declare module 'vite-gql' {

export function useQuery<T, V>(variables: UseQueryArgs.variables | null, options?: UseQueryOptions): UseQueryResponse<T, V>
export function useQuery<T, V>(queryName?: string, variables: UseQueryArgs.variables, options?: UseQueryOptions): UseQueryResponse<T, V>
export function useQuery<T, V>(variables?: UseQueryArgs.variables | null, options?: UseQueryOptions): UseQueryResponse<T, V>
export function useQuery<T, V>(variables?: UseQueryArgs.variables | null, options?: UseQueryOptions): UseQueryResponse<T, V>
export function useMutation<T, V>(query?: string): UseMutationResponse<T, V>
}
{
"name": "vite-plugin-vue-gql",
"description": "Vue SFC GraphQL Block",
"version": "0.0.1",
"version": "0.0.2",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "module": "dist/index.mjs",

# vite-plugin-vue-gql
### **⚠️ This Plugin is still in Development**
### **⚠️ This Plugin is still in Development and currently only works with the `<script setup>` format**
This plugin allows you to use `gql` blocks in your Vue SFC with Vitejs
### **⚠️ This plugin currently only works with the \<script setup> format**

@@ -80,2 +79,68 @@ ## Install

Multiple GQL Tags
```html
<!-- ExampleComponent.vue -->
<script setup>
import { useQuery } from 'vite-gql'
const { fetching, error, data } = useQuery()
const { fetching: userFetching, error: userError, data: userData } = useQuery('user', { name: 'Evan' })
</script>
<template>
...
</template>
<gql>
query($name: String!) {
info {
date
time
}
}
</gql>
<gql name="user">
query($name: String!) {
user(name: $name) {
username
avatar
bio {
description
}
}
}
</gql>
```
**Mutations**
```html
<!-- ExampleComponent.vue -->
<script setup >
import { useMutation } from 'vite-gql'
const { executeMutation } = mutation()
const createUser = (name) => {
executeMutation({ name })
}
</script>
<template>
...
</template>
<gql mutation>
mutation($name: String!) {
createUser(name: $name) {
username
created
}
}
</gql>
```
For more examples visit the `/examples/spa` directory in the repo

@@ -87,4 +152,4 @@

## Roadmap
- Support `useMutation` and `useSubscription`
- Support multiple named gql tags(or allow them to be tagged as mutations or subscriptions)
- Look into auto detecting used properties and auto-generating a GQL request
- [x] Support `useMutation` and `useSubscription`
- [x] Support multiple named gql tags(or allow them to be tagged as mutations or subscriptions)
- [ ] Look into auto detecting used properties and auto-generating a GQL request

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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