Git Product home page Git Product logo

federation-jvm-spring-example's Introduction

Federation JVM Spring Example

Apollo Federation JVM example implementation using Spring for GraphQL. If you want to discuss the project or just say hi, stop by the Apollo community forums.

The repository contains two separate projects:

  1. products-subgraph: A Java GraphQL service providing the federated Product type
  2. reviews-subgraph: A Java GraphQL service that extends the Product type with reviews

See individual projects READMEs for detailed instructions on how to run them.

Running the demo

  1. Start products-subgraph by running the ProductsApplication Spring Boot app from the IDE or by running ./gradlew :products-subgraph:bootRun from the root project directory

  2. Start reviews-subgraph by running the ReviewsApplication Spring Boot app from the IDE or ./gradlew :reviews-subgraph:bootRun from the root project directory

  3. Start Federated Router

    1. Install rover CLI
    2. Start router and compose products schema using rover dev command
    # start up router and compose products schema
    rover dev --name products --schema ./products-subgraph/src/main/resources/graphql/schema.graphqls --url http://localhost:8080/graphql
    1. In another shell run rover dev to compose reviews schema
    rover dev --name reviews --schema ./reviews-subgraph/src/main/resources/graphql/schema.graphqls --url http://localhost:8081/graphql
  4. Open http://localhost:3000 for the query editor

Example federated query

query ExampleQuery {
    products {
        id
        name
        description
        reviews {
            id
            text
            starRating
        }
    }
}

Other Federation JVM examples

federation-jvm-spring-example's People

Contributors

coderroggie avatar dariuszkuc avatar dependabot[bot] avatar renovate[bot] avatar rstoyanchev avatar svc-secops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

federation-jvm-spring-example's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • secops 2.0.7
docker-compose
docker-compose.yaml
  • ghcr.io/apollographql/router v1.32.0
dockerfile
products-subgraph/Dockerfile
  • openjdk 17
reviews-subgraph/Dockerfile
  • openjdk 17
github-actions
.github/workflows/continuous-integration.yaml
  • actions/checkout v3
  • gradle/wrapper-validation-action v1
  • actions/setup-java v3
  • gradle/gradle-build-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • gradle/wrapper-validation-action v1
  • actions/setup-java v3
  • gradle/gradle-build-action v2
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/download-artifact v3
  • actions/download-artifact v3
  • actions/download-artifact v3
gradle
gradle.properties
settings.gradle.kts
products-subgraph/build.gradle.kts
  • org.springframework.boot 3.3.0
  • io.spring.dependency-management 1.1.3
reviews-subgraph/build.gradle.kts
  • org.springframework.boot 3.3.0
  • io.spring.dependency-management 1.1.3
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.1

  • Check this box to trigger a request for Renovate to run again on this repository

"One of the values isn't valid for an argument"

Was just playing with this, as looks like a great example.. Spring boot apps are working fine.

When I execute the rover cli, I get the following:

⚠️ Do not run this command in production! ⚠️ It is intended for local development.
🛫 starting a session with the 'products' subgraph
🎶 composing supergraph with Federation v2.5.4.exe
ERROR: error: one of the values isn't valid for an argument
error: the router was unable to start up

👀 watching ./products-subgraph/src/main/resources/graphql/schema.graphqls for changes

Environment:

  • Windows 10
  • rover 0.19.1

I have tried different versions of rover back to 0.17.3 and got the same issue. Which version of rover is supported with this repo?

Any ideas?

Configure CI action

Currently we don't run any build on the PRs. We should create github action that would attempt to build the project to verify it still compiles.

Update to use router

This example repo should be updated to use new high performance Rust router instead of the Node Gateway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.