Giter Site home page Giter Site logo

gramps's Introduction

GrAMPS · An easier way to manage the data sources powering your GraphQL server

GrAMPS — Composable, Shareable Data Sources for GraphQL

license npm version Build Status Maintainability Test Coverage Greenkeeper badge All Contributors

An easier way to manage the data sources powering your GraphQL server.

GrAMPS (short for GraphQL Apollo Microservice Pattern Server) is a thin layer of helper tools designed for the Apollo GraphQL server that allows independent data sources — a schema, resolvers, and data access model — to be composed into a single GraphQL schema, while keeping the code within each data source isolated, independently testable, and completely decoupled from the rest of your application.

Developer Quickstart

To get a GrAMPS+Apollo gateway up and running, start by installing the required packages:

yarn add @gramps/gramps express apollo-server-express body-parser graphql

Next, create a file called index.js and put the following inside:

const Express = require('express');
const bodyParser = require('body-parser');
const gramps = require('@gramps/gramps').default;
const { GraphQLSchema } = require('graphql');
const { ApolloServer } = require('apollo-server-express');

const app = Express();
const GraphQLOptions = gramps();

app.use(bodyParser.json());
const server = new ApolloServer(GraphQLOptions)
server.applyMiddleware({ app, path: '/graphql' })

app.listen({ port: 8080 }, () =>
  console.log(`🚀 Server ready at http://localhost:8080${server.graphqlPath}`)
)

Start the server with node index.js, then open http://localhost:8080/graphql to see the GraphiQL user interface.

For a more in-depth starter, see the 5-minute quickstart in our documentation.

Why Does GrAMPS Exist?

GrAMPS is an attempt to create a standard for organizing GraphQL data source repositories, which allows for multiple data sources to be composed together in a plugin-like architecture.

The ability to combine independently managed data sources into a single GraphQL server is a core requirement for IBM Cloud’s microservice architecture. We have dozens of teams who expose data, so a single codebase with all GraphQL data sources inside was not an option; we needed a way to give each team control of their data while still maintaining the ability to unify and expose our data layer under a single GraphQL microservice.

GrAMPS solves this problem by splitting each data source into independent packages that are composed together into a single GraphQL server.

Contributors

Thanks goes to these wonderful people (emoji key):


Jason Lengstorf

💻 🎨 📖 📢

Eric Wyne

💻 🤔

Cory Cook

🤔

Michael Fix

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

gramps's People

Contributors

jlengstorf avatar ecwyne avatar shalkam avatar greenkeeper[bot] avatar mfix22 avatar ryanomackey avatar

Watchers

James Cloos avatar  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.