Skip to content

Star Wars Demo 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.

Requirements

  • JDK 17+ for Kotlin, or JDK 21+ for the Java demo, and git (see Project Setup).
  • A clone of the demo for your chosen language, using the commands below.
  • Linux, Mac, or Windows

What you'll find

Both language versions showcase the following patterns. Select a language tab on any page; the selection carries across this tutorial:

Getting the Star Wars application

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

The Java demo is part of the main Viaduct repository. It uses Micronaut and the Java tenant API.

git clone https://github.com/airbnb/viaduct.git
cd viaduct/demoapps/starwars-java

Running the application

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

./gradlew test
./gradlew run

The demo builds against the current Viaduct development snapshot. The environment flag enables the snapshot repository for both plugins and dependencies. On Windows, use Git Bash for these commands.

USE_VIADUCT_SNAPSHOT_REPO=true ./gradlew test
USE_VIADUCT_SNAPSHOT_REPO=true ./gradlew run

Open GraphiQL and try:

query {
  allCharacters(limit: 1) { name displayName }
}

The first character is Luke Skywalker. Stop the server with Ctrl+C.

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

What's Next

Continue to Core Concepts to walk through Viaduct's foundational building blocks as they appear in this demo.