StarWars Demo Application

Explore an advanced Viaduct application.

Overview

This application implements a comprehensive GraphQL API for the Star Wars universe, demonstrating how Viaduct handles complex data relationships, advanced resolver patterns, and sophisticated schema design.

What you’ll find

The StarWars demo showcases:

  • Node Resolvers: Direct object resolution patterns
  • Field Resolvers: Field-level data fetching strategies
  • Batch Resolution: Efficient bulk data loading techniques
  • Mutations: Modifying data through GraphQL mutations
  • Variables Provider: Dynamic variable injection and management
  • Backing Data: Using Kotlin objects as data sources in Viaduct
  • Global ID System: Viaduct’s approach to unique entity identification across your schema grts

Getting the starwars application

The StarWars application is available on GitHub at github.com/viaduct-graphql/starwars.

git clone https://github.com/viaduct-graphql/starwars.git
cd starwars

Running the application

Follow the instructions in the repository’s README to build and run the application:

./gradlew test
./gradlew run

After exploring the StarWars application, you’ll have a solid understanding of how to build production-ready GraphQL applications with Viaduct.


Architecture

A High-level architecture for the Viaduct Star Wars demo application.

Core Concepts

Viaduct core concepts applied in the Star Wars demo application.

Custom Directives

Learn about custom directives like @backingData, @scope, @idOf, and @oneOf in Viaduct.

Variables and Variable Providers

Using Variables and Variable Providers for dynamic field selection in Viaduct.

Mutations

Implementing mutation operations in the Star Wars demo app using Viaduct.

Integration Testing

Write resolver unit tests and HTTP integration tests using Viaduct.