Giter Club home page Giter Club logo

agogos's Introduction

graphql-gateway

It allows you to create a unified GraphQL API in a microservices architecture. Each microservice contributes to a single unified schema.

graphql-gateway is composed of these components:

  • registry - Continuously collects, validates and unifies all the schema parts
  • graphql-server - A single GraphQL API executed with the unified schema

Disclaimer

This deployment is NOT intended for a production environment. It is still a reference implementation and we plan to add some production-ready features like authantication & authorization soon.

Example

User Service

Rest service for User details

GET http://user/:id
{
  id: ...,
  firstName: ...,
  lastName: ...
}

POST http://user/:id
body {
  firstName: ...,
  lastName: ...
}

It would also contain a GQL file declaring this schema (notice the @http directive):

type User {
  id: ID!
  firstName: String
  lastName: String
}

type Query {
  user(id: ID!): User
  @http(url: "http://user/:id")
}

type Mutation {
  createUser(firstName: String!, lastName: String): String
  @http(url: "http://user/:id", method: "POST")
}

User Subscription service

Rest service for User Subscription details

GET http://user-subscription/:id
{
  plan: ...,
  expirationDate: ...
}

It would also contain a GQL file declaring a Subscription extension for the User type:

type SubscriptionPlan {
  plan: String!
  expirationDate: String
}

type User {
  subscription: SubscriptionPlan
  @http(url: "http://user-subscription/:id")
}

A query to the unified GraphQL schema could be:

query {
  user('some-id') {
    firstName
    lastName
    subscription {
      plan
      expoirationDate
    }
  }
}

It is actually resolved from the two separated services! Each is responsible for the schema extension and its own piece of data.

Service support

  • Rest service
  • gRPC service - planned
  • Databases - planned

Platform support

  • Kubernetes - planned
  • Any platform with a custom CD

agogos's People

Contributors

alef83 avatar yshayy avatar zahic avatar

Watchers

 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.