All Projects â†’ logaretm â†’ Villus

logaretm / Villus

Licence: mit
🏎 A tiny and fast GraphQL client for Vue.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Villus

Wp Graphql
🚀 GraphQL API for WordPress
Stars: ✭ 3,097 (+719.31%)
Mutual labels:  api, graphql, graphql-api, hacktoberfest
Countries
🌎 Public GraphQL API for information about countries
Stars: ✭ 156 (-58.73%)
Mutual labels:  api, graphql, apollo, graphql-api
Askql
AskQL is a query language that can express any data request
Stars: ✭ 352 (-6.88%)
Mutual labels:  api, graphql, hacktoberfest
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (-52.38%)
Mutual labels:  api, graphql, graphql-api
Graphback
Graphback - Out of the box GraphQL server and client
Stars: ✭ 323 (-14.55%)
Mutual labels:  graphql, apollo, hacktoberfest
Core
The server component of API Platform: hypermedia and GraphQL APIs in minutes
Stars: ✭ 2,004 (+430.16%)
Mutual labels:  api, graphql, hacktoberfest
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-57.67%)
Mutual labels:  api, graphql, graphql-api
Mercure
Server-sent live updates: protocol and reference implementation
Stars: ✭ 2,608 (+589.95%)
Mutual labels:  api, graphql, hacktoberfest
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (-88.1%)
Mutual labels:  api, graphql, apollo
Morpheus Graphql
Haskell GraphQL Api, Client and Tools
Stars: ✭ 285 (-24.6%)
Mutual labels:  graphql, graphql-api, graphql-client
Wp Graphql Acf
WPGraphQL for Advanced Custom Fields
Stars: ✭ 358 (-5.29%)
Mutual labels:  api, graphql, hacktoberfest
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+2801.32%)
Mutual labels:  api, graphql, graphql-api
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+10954.5%)
Mutual labels:  api, graphql, hacktoberfest
Android Okgraphql
Reactive GraphQl client for Android
Stars: ✭ 64 (-83.07%)
Mutual labels:  api, graphql, graphql-client
Altair
âœĻ⚡ïļ A beautiful feature-rich GraphQL Client for all platforms.
Stars: ✭ 3,827 (+912.43%)
Mutual labels:  graphql, hacktoberfest, graphql-client
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-52.12%)
Mutual labels:  api, graphql, graphql-api
Api Platform
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Stars: ✭ 7,144 (+1789.95%)
Mutual labels:  api, graphql, graphql-api
Graphql Music
ðŸŽļA workshop in building a GraphQL API
Stars: ✭ 33 (-91.27%)
Mutual labels:  api, graphql, graphql-api
Graphql Deduplicator
A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.
Stars: ✭ 258 (-31.75%)
Mutual labels:  graphql, apollo, graphql-client
Vulcain
Fast and idiomatic client-driven REST APIs.
Stars: ✭ 3,190 (+743.92%)
Mutual labels:  api, graphql, hacktoberfest

villus

codecov circleci Bundle Size npm npm

Villus is a finger-like structures in the small intestine. They help to absorb digested food.

A small and fast GraphQL client for Vue.js.

This is forked from my previous work at vue-gql before they decide to go for a different direction with this library.

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 and Supports GraphQL TS tooling
  • 🖇 Composable: Built for the Composition API
  • ⚡ïļ Suspense: Supports the <Suspense> API in Vue 3
  • 🔌 Plugins: Use existing plugins and create custom ones
  • Higher-order components available
  • Supports both Vue 2.x (with @vue/composition-api) and 3.0

Why use this

GraphQL is just a simple HTTP request. This library is meant to be a tiny client without all the bells and whistles attached to Apollo and its ecosystem which subsequently means it is faster across the board due to it's smaller bundle size and reduced overhead. villus offers simple strategies to cache and batch, dedup your GraphQL requests.

villus also supports file uploads and subscriptions without compromising bundle size through plugins.

If you are looking for a more full-featured client use vue-apollo, it has everything you need.

You can read more about it in the announcement post.

Documentation

You can find the documentation here

Quick Start

First install villus:

yarn add villus graphql

# or npm

npm install villus graphql --save

Or because villus is so simple, you can use it via CDN:

<!-- Import Vue 2 or 3 -->
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<!-- Vue Demi is needed for Vue 2 and 3 support -->
<script src="https://unpkg.com/[email protected]/lib/index.iife.js"></script>
<!-- Villus -->
<script src="https://unpkg.com/[email protected]/dist/villus.min.js"></script>

You can now use it with either the new Vue composition API or higher order components.

Usage

Configure the GraphQL client for your root component:

import { useClient } from 'villus';

export default {
  name: 'App',
  setup() {
    useClient({
      url: 'http://localhost:3002/graphql',
    });
  },
};

Then you can use useQuery in any child component:

<template>
  <div>
    <div v-if="data">
      <pre>{{ data }}</pre>
    </div>
  </div>
</template>

<script>
import { useQuery } from 'villus';

export default {
  setup() {
    const AllPosts = `
      query AllPosts {
        posts {
          title
        }
      }
    `;

    const { data } = useQuery({
      query: AllPosts,
    });

    return { data };
  },
};
</script>

There is also the higher-order component flavor if you prefer to use them instead. Read the docs for more examples and details.

villus makes frequent tasks such as re-fetching, caching, deduplication, mutations, and subscriptions a breeze. It has even built-in Suspense support with Vue 3! 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

Live examples can be found here

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].