Developed by szaske
A GraphQL server that proxies the Github GraphQL service. The server accepts GraphQL queries from clients and resolves them by passing the queries on to Github's own service. If you're looking for code examples of a proxy GraphQL server this repo will be helpful to you. Unique working code that can be found here includes:
- How to construct a github GraphQL query using node-fetch, including creating authorization headers and passing custom variables
- A design pattern for transforming the query data before send it along to clients
Like most development projects this code requires that you have some basic development tools installed on your development system; Git, Node.js and NPM. You'll also need a Github access token and and Apollo Engine API-KEY. You can find the instructions for creating a Github token here, and instructions for creating an Apollo Engine API-KEY here
git clone https://github.com/szaske/apollo-github-proxy-server.git
cd apollo-github-proxy-server
npm install
Create a file called .env in the projects root folder
touch .env
This is where you'll store your Github access token and Engine API-KEY. Edit the file to include these lines:
GITHUB_TOKEN=[Put your access token here without brackets]
ENGINE_API_KEY=[Put your full Engine API-KEY here]
Now the server should run.
npm start
If you want to explore the servers functionality you can open http://localhost:4000/graphiql
- GraphQL - The JavaScript reference implementation for GraphQL
- Apollo Server Express - A GraphQL server built on Express
- node-fetch - a window.fetch compatible API on Node.js
This project is licensed under the MIT License - see the LICENSE file for details