GithubHelp home page GithubHelp logo

graphql's Introduction

GraphQL implementation

TypeScript code of this project is a part of me doing a Udemy Course AWS AppSync & Amplify with React & GraphQL - Complete Guide.

Java code of this project is a part of me extending the knowledge on GraphQL and I used this Youtube Playlist to understand Java implementation: Spring Boot GraphQL Tutorial - Full Course. The author has this course on Github.

Docker files are an additional parts that make this repo run smoothly.

Starting up GraphQL

To run all docker containers execute docker-compose up --build comman in the root direcotry. This will run four containers:

  1. MongoDB that will be accessible on default port 27017.
  2. Mongo-Express, a web GUI to interact with MongoDB.
  3. Node App with two GraphQL implementations (on two different URLs).
  4. A Java Microservice that exposes:
    • few REST endpoints,
    • the main GraphQL endpoint,
    • Playground endpoint
    • and Voyager endpoint.

To stop all of these containers run docker-compose down. And the subsequent start of these containers can be faster if run without --build option since all of these containers are already built. Execute just docker-compose up.

Connecting to Mongo DB

First, the easy way, is to open a web page at localhost:8081 which is an exposed Mongo-Express page to mange Mongo database.

Second way is to connect directly to a Mongo DB (e.g. with the VS Code) use the following connection string:

mongodb://mongo_user:[email protected]:27017/graph_ql_db?authSource=admin

Interacting with GraphQL

The Node App has two URLs. One uses an internal variables (in TypeScript code) to store data. The second URL uses the mentioned Mongo DB to store data. These URLs are:

The Java Microservice has two URLs related to GraphQL. One URL is expose documentation and a place to play with GraphQL queries and mutations. The other URL is to visualize relations between objects. Data are stored in the same Mongo DB as Node App uses.

Interacting with REST Endpoints

These are a Spring Boot Microservice endpoints and they can be used either by Postman or via Swagger page avaliable at localhost:

These REST endpoints provides the same functionality as GraphQL endpoint in Java Microservice. Data are stored in the same Mongo DB as GraphQL Java endpoint a d Node App use.

graphql's People

Contributors

cookiemr 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.