GraphQL

Apollo Server query GraphQL from ElasticSearch

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

Image for post
Image for post
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

Then we can get the data from GraphiQL infterface.

Hope it helps.

~~~PEACE~~~

Written by

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

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