Giter Site home page Giter Site logo

graphql-server's Introduction

Node Graphql Server

A simple project investigating graphql setup and its use cases, as well as tooling. It uses:

  • graphql-yoga - a fully-featured GraphQL server. It is based on Express.js and a few other libraries to help you build production-ready GraphQL servers.

  • prisma - a graphql to database connector

Installation

This project uses the yarn package manager to handle all dependencies

yarn install

It is useful to have the graphql cli installed as well

yarn global add graphql-cli

Prisma needs to be started to generate the schema and set up the connection to the Prisma layer

prisma deploy

This step will hopefully be made redundant with containerisation

To start up the project use

node src/index.js

Graphql playground will be available on localhost:3000 running the command will open this with both application and database layer connections available as described in .graphqlconfig.yml

graphql playground

Using Prisma

Prisma is used to create database bindings allowing a full CRUD API to be generated automatically for database operations. This allows us to delegate database calls to this database layer which will be resolved and managed by Prisma.

This is beneficial from the point of view that grahpql queries with nested resolvers can very quickly become difficult to manage. The node layer (Application Schema) still acts as an entry point for the the database layer so operations such as authorisation or logic can take place here before or after database interaction.

To do

Containerise the whole project to run Prisma on a local instance with a single entry point for the whole project

graphql-server's People

Contributors

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