@hrwg/apollo-nuxt
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Apollo Nuxt Module

npm version

This module integrates Apollo GraphQL for Vue with Nuxt 3.

Please note

Since @vue/apollo-composable is still in alpha and this module depends on it, caution is advised, since future changes may occur that break the functionality or compatibility of this module.

Features

  • Creation and injection of an Apollo GraphQL client into a Nuxt 3 app
  • Functional on server- and client-side
  • Enables use of @vue/apollo-composable

Current Limitations

  • Only configuration is the uri of the GraphQL endpoint
  • Due to @vue/apollo-composable being in alpha, breaking changes may occur in the future

Installation

The module can be installed by running the following command:

npm i @hrwg/apollo-nuxt

It is activated and configured, by adding it to the nuxt.config.ts.

import { defineNuxtConfig } from 'nuxt';

export default defineNuxtConfig({
    modules: [
        '@hrwg/apollo-nuxt',
    ],
    apolloNuxt: {
        uri: 'http://localhost:3000/api/graphql',
    },
});

The configuration parameter uri is the GraphQL endpoint.

Usage

After installation, GraphQL queries can be executed according to the Vue Apollo Documentation.

For a simple example, refer to the Playground Project.

Development

  • Run npm i to install dependencies.
  • Run npm run dev:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.

Changelog

This project adheres to Semantic Versioning. Please refer to the CHANGELOG.md for detailed changes and migration instructions.

License

MIT

Package Sidebar

Install

npm i @hrwg/apollo-nuxt

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

7.07 kB

Total Files

12

Last publish

Collaborators

  • rherwig4711