Giter Club home page Giter Club logo

lightgraph-poc's Introduction

LightGraph Proof-Of-Concept

This is a "cheap and cheerful" throwaway version of a GraphQL API Gateway, slapped together in a few hours just to see what a GraphQL facade of our APIs would even look like. This version is written in Rails using ruby-graphql, purely because that is the framework in which I personally can most quickly slap together a POC. I imagine a real version would be written in Go, probably using the Wundergraph library.

How to run the LightGraph POC locally

As a prerequisite, you'll need Ruby and the Bundler gem installed:

brew install ruby
gem install bundler

Make sure you have defined these environment variables:

export LS_TOKEN=[your api key]
export LS_PUBLICAPI_URL="https://api.staging.lightstep.com/public/v0.2" # Or whatever you prefer

Then, check out this POC code, navigate to the project's root directory, and run the server:

bundle install  # only needed the first time, to install dependencies
rails server

How to query the LightGraph POC

There's a built-in web ui for building and submitting queries out of the box, called GraphiQL (pronounced "graphical"... because it's a graphical UI... for GraphQL... GET IT?? ๐Ÿ˜ƒ). By default, the service binds to port 3000, so you'd be able to reach GraphiQL at http://localhost:3000/graphiql. You can also use curl (or your http client of choice) to send GraphQL requests directly to the API, as so:

curl 'http://localhost:3000/graphql' \
  -H 'Content-Type: application/json' \
  -d '{"query":"{organization(id:\"LightStep\") { id name projects { id } } }"}'

lightgraph-poc's People

Contributors

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