All Projects → baianat → vue-gql

baianat / vue-gql

Licence: MIT license
A small and fast GraphQL client for Vue.js

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-gql

DotNetGraphQL
A sample demonstrating how to create a GraphQL Backend in .NET and consume it from a .NET mobile app created using Xamarin
Stars: ✭ 78 (+143.75%)
Mutual labels:  graphql-client
flutter-graphql
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo
Stars: ✭ 45 (+40.63%)
Mutual labels:  graphql-client
mint-ui
The UI library of Mint
Stars: ✭ 56 (+75%)
Mutual labels:  component-library
bindable
A design system built in Aurelia JS that allows for faster and easier web development.
Stars: ✭ 20 (-37.5%)
Mutual labels:  component-library
StarWars
Minimal GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample (using StarWars endpoint - https://graphql.org/swapi-graphql)
Stars: ✭ 165 (+415.63%)
Mutual labels:  graphql-client
paragon
💎 An accessible, theme-ready design system built for learning applications and Open edX.
Stars: ✭ 85 (+165.63%)
Mutual labels:  component-library
Neuron
A GraphQL client for Elixir
Stars: ✭ 244 (+662.5%)
Mutual labels:  graphql-client
react-showroom
Document React components by declaring props definition and writing markdown.
Stars: ✭ 40 (+25%)
Mutual labels:  component-library
decapi
Create GraphQL API by decorating TypeScript classes
Stars: ✭ 81 (+153.13%)
Mutual labels:  gql
react-transition-components
Easily configurable React components for animations / transitions 💃
Stars: ✭ 18 (-43.75%)
Mutual labels:  component-library
artemis
Ruby GraphQL client on Rails that actually makes you more productive
Stars: ✭ 149 (+365.63%)
Mutual labels:  graphql-client
vue-component-lib-starter
A bare-bones example of creating your own Vue component library.
Stars: ✭ 221 (+590.63%)
Mutual labels:  component-library
react-dsfr
Non-official React components of the official french Système de Design de l'État.
Stars: ✭ 48 (+50%)
Mutual labels:  component-library
gatsby-starter-redux-saas
An Gatsby starter for Saas products. Uses redux and apollo and a graphql token auth backend.
Stars: ✭ 18 (-43.75%)
Mutual labels:  graphql-client
cauldron
cauldron.dequelabs.com/
Stars: ✭ 50 (+56.25%)
Mutual labels:  component-library
Apollo Android
🤖  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
Stars: ✭ 2,949 (+9115.63%)
Mutual labels:  graphql-client
miter-design
Miter Design component library made with ♡ by Prefect
Stars: ✭ 14 (-56.25%)
Mutual labels:  component-library
galoy-pay
A web application that can be used to send tips or payments to users
Stars: ✭ 21 (-34.37%)
Mutual labels:  graphql-client
vue-devui-early
Vue3版本的DevUI组件库。本仓库已迁移至:https://github.com/DevCloudFE/vue-devui
Stars: ✭ 39 (+21.88%)
Mutual labels:  component-library
vue-component-template
Vue.js template to build standalone components
Stars: ✭ 21 (-34.37%)
Mutual labels:  component-library

vue-gql

A small and fast GraphQL client for Vue.js.

codecov Build Status Bundle Size

Features

  • 📦 Minimal: Its all you need to query GQL APIs.
  • 🦐 Tiny: Very small footprint.
  • 🗄 Caching: Simple and convenient query caching by default.
  • 💪 TypeScript: Written in Typescript.
  • 💚 Minimal Vue.js Components.

Documentation

You can find the full documentation here

Quick Start

First install vue-gql:

yarn add vue-gql graphql

# or npm

npm install vue-gql graphql --save

Setup the GraphQL client/endpoint:

import Vue from 'vue';
import { withProvider, createClient } from 'vue-gql';
import App from './App.vue'; // Your App Component

const client = createClient({
  url: 'http://localhost:3002/graphql'
});

// Wrap your app component with the provider component.
const AppWithGQL = withProvider(App, client);

new Vue({
  render: h => h(AppWithGQL)
}).$mount('#app');

Now you can use the Query and Mutation components to run queries:

<template>
  <Query query="{ posts { title } }" v-slot="{ data, fetching }">
    <div v-if="fetching">Is Fetching ...</div>
    <div v-else>
      <pre>{{ data }}</pre>
    </div>
  </Query>
</template>

<script>
import { Query } from 'vue-gql';

export default {
  components: {
    Query
  }
};
</script>

You can do a lot more, vue-gql makes frequent tasks such as re-fetching, caching, mutation responses, error handling, subscriptions a breeze. Consult the documentation for more use-cases and examples.

Compatibility

This library relies on the fetch web API to run queries, you can use unfetch (client-side) or node-fetch (server-side) to use as a polyfill.

Examples

SOON

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].