Coder Social home page Coder Social logo

jscomplete / graphql-in-action Goto Github PK

View Code? Open in Web Editor NEW
413.0 5.0 41.0 310 KB

A GraphQL project with a backend component written with GraphQL-js and Apollo Server and a frontend component written in React.

Home Page: https://bit.ly/graphql-in-action

JavaScript 73.97% CSS 24.97% HTML 0.75% Shell 0.31%
graphql javascript

graphql-in-action's Introduction

GraphQL In Action

A GraphQL project with a backend component written with GraphQL-js and Apollo Server and a frontend component written in React. Branch "main" is the starting point for the GraphQL In Action book. Other branches are used to track the progress of updates throughout the book:

  • Branch "5.0" is the starting point (Chapter 5 in the book). This is an alias for the "main" branch.

  • Branch "9.0" has a working version of the React app before using the GraphQL API. This is the point where the GraphQL API is complete (except for subscriptions, which are implemented in Chapter 10)

  • Branch "10.0" has a worknig version of using a GraphQL client with a React app without a client library (like Apollo).

  • Branch "10.10" (aliased as "final") has the same React app after converting all data communications to use Apollo Client, adding subscriptions operations, and doing the entire local app state management with Apollo.

Install dependencies

npm install

Start databases

You’ll need Docker Compose (which is part of Docker Desktop).

Then run:

npm run start-dbs

This will download and start a PostgreSQL database container on port 5432 and a MongoDB container on port 27017. Both databases have some sample development data loaded in. The connection credentials for these databases are:

PG_CONNECTION_STRING  = "postgres://postgres:password@localhost:5432/azdev"
MDB_CONNECTION_STRING = "mongodb://localhost:27017/azdev"

If you already have a PostgreSQL database that you would like to use instead of the provided Docker containers, you will need to create the database schemas for the project using the dev-db/schema.* files (which will also load the sample data).

Using psql:

psql -d "postgres://postgres:password@localhost:5432" -c "create database azdev"
psql -d "postgres://postgres:password@localhost:5432/azdev" < dev-dbs/schema.sql

Using mongo:

mongo mongodb://127.0.0.1:27017/ < dev-dbs/schema.mongo

Run for dev

In 2 different terminals:

npm run api-server
npm run web-server

Defaults:

graphql-in-action's People

Contributors

samerbuna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graphql-in-action's Issues

Modules import each other

I got an issue:
task.js : import User from './user.js'
user.js : import Task form './task.js'
How to fix this problem?
Please help!

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.