Apollo Server query GraphQL from ElasticSearch

This is a simple Apollo Server to get started using GraphQL, querying data from ElasticSearch.

Photo by NASA on Unsplash

For getting started with ElasticSearch, please follow the previous guideline from here.

TL;DR → please get the source code from github.

Now we will start to implement a simple server with Apollo.

server.graphql.js

server.elasticsearch.js

server.js

Run the server with node

node server/server.js

Then we can get the data from GraphiQL infterface.

Query data example

Hope it helps.

~~~PEACE~~~

--

--

--

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JavaScript Antipatterns — Immediate Functions

Node.js Tips — REPL Tips, Socket.io Connections, and Event Listenrs

React Patterns | Different Patterns for React JS

Vue Select — Loading Options and Loops

React Native — Drawer and Permissions

Step by Step: Building and Deploying an Angular 2 CLI project to Azure App Services using VSTS

Cross-Browser Voice Commands with React

Create a Background Color Switcher App with React and JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Le

Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

More from Medium

How to Share GRPC Proto Buffers Files Across Microservices

Kong Plugins as Microservices: Writing a Single-Plugin Server for Kong in Go

Postgres 10/11/12/13 new features and benefits

Tracing Node.js application with OpenTelemetry & Jaeger UI