All Projects → kbrandwijk → graphcool-gateway-apollo-engine-demo

kbrandwijk / graphcool-gateway-apollo-engine-demo

Licence: GPL-3.0 License
This demo demonstrates using Apollo Engine with the Graphcool API Gateway pattern

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to graphcool-gateway-apollo-engine-demo

Graphql Api Gateway
An open-sourced example of a GraphQL API Gateway. This service queries and joins data across different back-ends into one GraphQL schema.
Stars: ✭ 57 (+119.23%)
Mutual labels:  api-gateway, apollo-server
kong-upstream-jwt
A plugin for Kong which adds a signed JWT to HTTP Headers to backend requests
Stars: ✭ 40 (+53.85%)
Mutual labels:  api-gateway
aws lambda ftp function
AWS Lambda Function to connect to FTP, download files and save them to S3 bucket
Stars: ✭ 55 (+111.54%)
Mutual labels:  api-gateway
apollo-graphql-tutorial
Learning apollo graphql version 2.x with Node.js
Stars: ✭ 18 (-30.77%)
Mutual labels:  apollo-server
3scale-security-oidc-demo
Securing APIs with OpenID Connect using 3scale API Management and Red Hat Single Sign On
Stars: ✭ 25 (-3.85%)
Mutual labels:  api-gateway
mongoose-graphql-pagination
GraphQL cursor pagination (Relay-like) for Mongoose models.
Stars: ✭ 29 (+11.54%)
Mutual labels:  apollo-server
example-step-functions-integration-api-gateway
Example application using the new Step Functions integration with API Gateway. It developers to call API Gateway REST APIs and API Gateway from a Step Functions workflow.
Stars: ✭ 17 (-34.62%)
Mutual labels:  api-gateway
djangoapigateway
This is a simple apigateway for django to transmit restful api.
Stars: ✭ 40 (+53.85%)
Mutual labels:  api-gateway
arbor
Statically configured API Gateway framework
Stars: ✭ 13 (-50%)
Mutual labels:  api-gateway
reactivesearch-api
API Gateway for Elasticsearch with declarative querying and out-of-the-box access controls
Stars: ✭ 146 (+461.54%)
Mutual labels:  api-gateway
hano-graphql
GraphQL, Hapi and Node Project For Scaleable Apps.
Stars: ✭ 13 (-50%)
Mutual labels:  apollo-server
graphql-typeorm-koa-workshop
Demo GraphQL API server
Stars: ✭ 36 (+38.46%)
Mutual labels:  apollo-server
graphql-gateway-apollo-express
Creating high performance and secure GraphQL APIs with Node.js, Apollo server, GraphQL and TypeScript
Stars: ✭ 122 (+369.23%)
Mutual labels:  api-gateway
cv4pve-api-dotnet
Proxmox VE Client API .Net C#
Stars: ✭ 25 (-3.85%)
Mutual labels:  api-gateway
kong
Kong docker image that easily installs plugins from source code.
Stars: ✭ 20 (-23.08%)
Mutual labels:  api-gateway
webpack-aws-lambda
AWS Lambda that runs webpack and output the bundle.js file
Stars: ✭ 12 (-53.85%)
Mutual labels:  api-gateway
mlapi
An easy to use/extend object recognition API you can locally install. Python+Flask. Also works with ZMES!
Stars: ✭ 49 (+88.46%)
Mutual labels:  api-gateway
api-gateway
Api Gateway for a microservices deployment
Stars: ✭ 31 (+19.23%)
Mutual labels:  api-gateway
entria-todo
React Native + Relay Modern + Graphcool
Stars: ✭ 13 (-50%)
Mutual labels:  graphcool
Helios
An open source and easy-to-use monitoring tool for your AWS serverless applications.
Stars: ✭ 51 (+96.15%)
Mutual labels:  api-gateway

graphcool-gateway-apollo-engine-demo

This demo demonstrates using Apollo Engine with the Graphcool API Gateway pattern. It contains a simple example with one endpoint, and an advanced example that stitches together two endpoints. It also contains an example that takes advantage of the new Apollo Cache Control.

Simple example

Setup

image

image

  • Create a .env file in the root of your project folder with the following keys:
    • GRAPHCOOL_ENDPOINT
    • APOLLO_ENGINE_KEY
GRAPHCOOL_ENDPOINT=https://api.graph.cool/simple/v1/...
APOLLO_ENGINE_KEY=service:xxx:.......
  • Run yarn install or npm install

  • Run yarn start or npm start

image

image

  • Go over to the Apollo Engine website to check your metrics

image

image

Notes

  • Unfortunately, makeRemoteExecutableSchema turns every query into a single request to the underlying API (our Graphcool API). This means the metrics will not show any useful data about how your query is actually executed by the Graphcool server. It does, however, give you an overall indication of relative performance.

Advanced example

The advanced example combines two different endpoints, one with Posts, and one with Comments. Now, the tracing from Apollo Engine becomes a lot more interesting. I selected two different regions to illustrate the difference between the two endpoints.

image

  • Create a .env file in the root of your project folder with the following keys:
    • GRAPHCOOL_POST_ENDPOINT
    • GRAPHCOOL_COMMENT_ENDPOINT
    • APOLLO_ENGINE_KEY

If you leave out the endpoint keys, it will use two demo endpoints (read-only). If you want to use your own endpoints, use the schemas from the schemas folder to set up your endpoints.

  • Start with yarn start:merged or npm start:merged

image

Caching example

The caching example takes advantage of the new Apollo Cache Control standard, implemented by Apollo Server, and recognized by Apollo Engine. Based on caching hints delivered by Apollo Server, Apollo Engine applies intelligent caching to the queries.

  • Use the same set up as for the advanced example

  • Execute a query in the Playground. The first time, you will notice an extra result node, called extensions. This node contains caching hints.

image

  • The second time the query runs, caching is applied by Apollo Engine, and the results are returned immediately. This is reflected in the Apollo Engine report. The first request took 792 ms, the second request 1 ms, thanks to the inmemory local cache from Apollo Engine:

image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].