Git Product home page Git Product logo

odyssey-voyage-i-lab's Introduction

Voyage I Lab: Updating to Federation v2

Welcome to Voyage I Lab! In this hands-on project we'll take the companion app of Odyssey Voyage I, FlyBy, and update it to use Apollo Federation v2! You can find the course lessons and instructions in Odyssey, Apollo's learning platform.

You can preview the completed demo app here.

How to use this repo

The lab will walk you step by step through how to implement the features you see in the demo app. This codebase is the starting point of your journey!

Backend

You will work in four main folders:

  • gateway
  • subgraph-activities
  • subgraph-locations
  • subgraph-reviews

The course will help you set up and run each of these servers.

Frontend

The repo also includes a client folder, which includes the frontend for the FlyBy app. We'll make a few updates in this folder at the end of the course.

To run the client:

  1. Open a new terminal window, and navigate to the client folder.
  2. Run npm install & npm start. This will install all packages in the client and start the application in localhost:3000.

final folder

The repo also includes a final folder, to show what your code should look like once you've finished the course. You can use it to check your work if you get stuck.

To run the servers in the final folder:

  1. Open a new terminal window, and navigate to final/gateway.
  2. Run npm install && npm start. This will install all packages in the main server, then start the main server at http://localhost:4000.
  3. Open another new terminal window, and navigate to final/subgraph-locations.
  4. Run npm install && npm start again. This will install all packages for the locations subgraph, then start the subgraph at http://localhost:4001.
  5. Open a third new terminal window, and navigate to final/subgraph-reviews.
  6. Run npm install && npm start again. This will install all packages for the reviews subgraph, then start the subgraph at http://localhost:4002.
  7. In a web browser, open Apollo Studio Sandbox for http://localhost:4000. You should be able to run queries against your gateway server. Some test queries are included in the following section.

Queries

  1. Get all locations for the homepage.

    query getAllLocations {
      locations {
        id
        name
        photo
        description
        overallRating
      }
    }
  2. Get the latest reviews for the homepage.

    query LatestReviews {
      latestReviews {
        comment
        rating
        location {
          name
          description
        }
      }
    }
  3. Get details for a specific location.

    query getLocationDetails {
      location(id: "loc-1") {
        id
        name
        description
        photo
        overallRating
        reviews {
          comment
          rating
        }
      }
    }
  4. Submit a review for a location.

    mutation submitReview {
      submitReview(review: { comment: "Wow, such a great planet!", rating: 5, locationId: "1" }) {
        code
        success
        message
        review {
          id
          comment
          rating
        }
      }
    }

Getting Help

For any issues or problems concerning the course content, please refer to the Odyssey topic in our community forums.

odyssey-voyage-i-lab's People

Contributors

lizhennessy avatar mabuyo avatar meganesu avatar

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.