Git Product home page Git Product logo

hive-workshop's Introduction

GraphQL Hive Workshop

This repository contains the material used in the GraphQL Hive Workshop at GraphQL Conf 2023.

You can find the workshop slides here.

The video for the workshop will be added later on as it is available on YouTube.

Prerequisites

  • Install Docker on your machine
  • Install Node.js on your machine
  • Install pnpm on your machine

Install dependencies

pnpm install

Diff Schemas with GraphQL Inspector

Add new Field

pnpm graphql-inspector diff \
  inspector-schemas/add-new-field-before.graphql \
  inspector-schemas/add-new-field-after.graphql

Make Field Type Nullable

pnpm graphql-inspector diff \
  inspector-schemas/make-field-type-nullable-before.graphql \
  inspector-schemas/make-field-type-nullable-after.graphql

Make Field Non-Type Nullable

pnpm graphql-inspector diff \
  inspector-schemas/make-field-type-non-nullable-before.graphql \
  inspector-schemas/make-field-type-non-nullable-after.graphql

Change Field Type

pnpm graphql-inspector diff \
  inspector-schemas/cha
nge-field-type-before.graphql \
  inspector-schemas/change-field-type-after.graphql

Starting Hive

pnpm run start:hive

Start Subgraphs

pnpm run start:subgraphs

Publish Subgraphs

Echo

pnpm hive schema:publish \
  ./subgraphs/echo/src/main.ts \
   --service echo \
   --url http://localhost:7005

Accounts

pnpm hive schema:publish \
  ./subgraphs/accounts/src/main.ts \
   --service accounts \
   --url http://localhost:7001

Products

pnpm hive schema:check \
  ./subgraphs/products/src/main.ts \
   --service products

pnpm hive schema:publish \
  ./subgraphs/products/src/main.ts \
   --service products \
   --url http://localhost:7003

Inventory

pnpm hive schema:check \
  ./subgraphs/inventory/src/main.ts \
   --service inventory

pnpm hive schema:publish \
  ./subgraphs/inventory/src/main.ts \
   --service inventory \
   --url http://localhost:7002

Reviews

pnpm hive schema:check \
  ./subgraphs/reviews/src/main.ts \
   --service reviews

pnpm hive schema:publish \
  ./subgraphs/reviews/src/main.ts \
   --service reviews \
   --url http://localhost:7004

Download Apollo Router

curl -fsSL https://graphql-hive.com/apollo-router-download.sh | bash

Run Apollo Router

HIVE_CDN_ENDPOINT="http://localhost:8082/artifacts/v1/653d03a9-16c0-407d-ad26-78f5c10c76d8" \
  HIVE_CDN_KEY="hv2ODFlNDk0YzctMmQ1ZC00YzZkLWJhMmEtODYzYmI1MGYzODYyOjJkNzViZTk2MjVjMjUzOWQzMTZhZDc2NGU5Y2I3MDBhZGNlYjUwMWE=" \
  ./router --dev

Run Apollo Router with Usage Reporting

HIVE_TOKEN="99c12887d40e9ad41aaa0e46677b064b" \
  HIVE_ENDPOINT="http://localhost:8081" \
  HIVE_CDN_ENDPOINT="http://localhost:8082/artifacts/v1/653d03a9-16c0-407d-ad26-78f5c10c76d8" \
  HIVE_CDN_KEY="hv2ODFlNDk0YzctMmQ1ZC00YzZkLWJhMmEtODYzYmI1MGYzODYyOjJkNzViZTk2MjVjMjUzOWQzMTZhZDc2NGU5Y2I3MDBhZGNlYjUwMWE=" \
  ./router --dev --config supergraph.yaml

Further Links

hive-workshop's People

Contributors

n1ru4l 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.