An open API service indexing awesome lists of open source software.

https://github.com/productdevbook/nuxt-4-graphql-yoga

with nuxt 4 and a template of how graphql should be used.
https://github.com/productdevbook/nuxt-4-graphql-yoga

graphql graphql-yoga nitro nitrojs nuxt nuxt4

Last synced: 24 minutes ago
JSON representation

with nuxt 4 and a template of how graphql should be used.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Nuxt 4 with GraphQL Yoga

A modern, high-performance Nuxt 4 starter template with GraphQL Yoga integration for building robust GraphQL APIs.

## โœจ Introduction

This project demonstrates how to integrate GraphQL Yoga with Nuxt 4, providing a powerful backend for your Nuxt applications. GraphQL Yoga is a fully-featured GraphQL server with focus on easy setup, performance and great developer experience.

## ๐Ÿ”— GraphQL Yoga Integration

This template comes with pre-configured GraphQL Yoga setup:

- ๐ŸŒ Accessible GraphQL API endpoint at `/api/graphql`
- ๐Ÿ’“ Health check endpoint at `/api/graphql/health`
- ๐Ÿงช Interactive Apollo Sandbox for testing queries
- ๐Ÿ“‹ Server-side schema definition and resolvers
- ๐Ÿ›ก๏ธ Type-safe integration with Nuxt's Nitro server

## ๐Ÿ“˜ Features

- โšก Fast setup with minimal configuration
- ๐Ÿ”„ Hot Module Replacement during development
- ๐Ÿ“ฑ Built-in responsive Apollo Sandbox interface
- ๐Ÿงฉ Modular schema design
- ๐Ÿ”’ Type-safe GraphQL implementation

## ๐Ÿ“š Learn More

- [GraphQL Yoga Documentation](https://the-guild.dev/graphql/yoga-server)
- [Nuxt Documentation](https://nuxt.com/docs)
- [Apollo Sandbox Documentation](https://www.apollographql.com/docs/studio/explorer/sandbox)

## ๐Ÿ“Š Using the GraphQL API

Once your server is running, you can:

1. Access the Apollo Sandbox by navigating to `/api/graphql`
2. Test the API with a simple query:
```graphql
query {
hello
ping
}
```
3. Integrate with your frontend using your favorite GraphQL client

## ๐Ÿ› ๏ธ Setup

Make sure to install dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## ๐Ÿง‘โ€๐Ÿ’ป Development Server

Start the development server on `http://localhost:3000`:

```bash
# pnpm
pnpm dev
```

## ๐Ÿญ Production

Build the application for production:

```bash
# pnpm
pnpm build
```

Locally preview production build:

```bash
# pnpm
pnpm preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

---

Made with โค๏ธ by [productdevbook](https://github.com/productdevbook) | [GitHub](https://github.com/productdevbook) | [Website](https://productdevbook.com)