GithubHelp home page GithubHelp logo

jokejason / neo4j-graphql-books Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 173 KB

A practise project that implement integration test for apollo server with neo4j as database

License: Apache License 2.0

TypeScript 78.46% JavaScript 10.41% Dockerfile 11.13%

neo4j-graphql-books's Introduction

neo4j-graphql-books

This is a simple practise project of a GraphQL API backed by a Neo4j database. The major purpose of this project is to

  1. Create Apollo Server with Neo4j GraphQL integration
  2. Create integration tests following Apollo Docs: Testing using executeOperation

This project is bootstrapped using node-typescript-boilerplate

Context

Apollo Server is a powerful GraphQL server that can be used with many different data sources. With Neo4j GraphQL library, it's even more powerful.

Developer just need specify datatype and relationship in GraphQL schema, and Neo4j GraphQL library will generate the resolvers automatically for you. It greatly reduce boilerplate code.

Another benefit of Neo4j + Apollo Server is that there is no need to write unit test for many low level web framework functionality, as they are all handled gracefully by these libraries. And our most focus is on integration tests (i.e. whether schema generated typeDef behave correctly)

But there is not much information about how to write integration tests for Apollo Server with Neo4j GraphQL library. This project demonstrate how to write integration tests using Apollo Server's executeOperation function.

Getting Started

Pre-requisite

  1. Installed neo4j database
  2. Created a database named neo4j-graphql-books and start the database

Run the project following step

  1. Switch node version by nvm use
  2. Build: npm run build
  3. Start: npm run start

Run test

  1. npm run test

Run test in containers

  1. npm run test-containers

References

neo4j-graphql-books's People

Contributors

jokejason avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.