Skip to content

davi-souza/nodejs-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NODEJS with ELASTICSEARCH and GRAPHQL

Build images:

docker-compose build --no-cache

Install node packages:

docker-compose run node npm i

Run containers:

docker-compose up

Step One: Populate elasticsearch container

Data Structure:

authors = [
  { id: 1, firstName: 'Tom', lastName: 'Coleman' },
  { id: 2, firstName: 'Sashko', lastName: 'Stubailo' },
  { id: 3, firstName: 'Mikhail', lastName: 'Novikov' },
];
posts = [
  { id: 1, authorId: 1, title: 'Introduction to GraphQL', votes: 2 },
  { id: 2, authorId: 2, title: 'Welcome to Apollo', votes: 3 },
  { id: 3, authorId: 2, title: 'Advanced GraphQL', votes: 1 },
  { id: 4, authorId: 3, title: 'Launchpad is Cool', votes: 7 },
]

Query used:

`{
  posts {
    id
    title
    author {
      firstName
      lastName
    }
  }
}`

Step Two: Query Result

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published