All Projects → maapteh → graphql-modules-app

maapteh / graphql-modules-app

Licence: MIT license
TypeScripted Apollo GraphQL Server using modules and a NextJS frontend utilising React modules with Apollo hooks. All bundled with a lot of dev friendly tools in a lerna setup..

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to graphql-modules-app

Pup
The Ultimate Boilerplate for Products.
Stars: ✭ 563 (+1343.59%)
Mutual labels:  apollo, graphql-server
Apollo Server Vercel
⚫ Production-ready Node.js GraphQL server for Vercel Serverless Functions
Stars: ✭ 69 (+76.92%)
Mutual labels:  apollo, graphql-server
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-28.21%)
Mutual labels:  apollo, dataloader
Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+7615.38%)
Mutual labels:  graphql-server, dataloader
apollo-express-ts-server-boilerplate
No description or website provided.
Stars: ✭ 29 (-25.64%)
Mutual labels:  apollo, graphql-server
Graphql Up
Get a ready-to-use GraphQL API for your schema
Stars: ✭ 415 (+964.1%)
Mutual labels:  apollo, graphql-server
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (+15.38%)
Mutual labels:  apollo, graphql-server
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-51.28%)
Mutual labels:  apollo, graphql-server
react-native-instagram-clone
Instagram Clone (light version) — Graphql + React (ios, android, web)
Stars: ✭ 29 (-25.64%)
Mutual labels:  apollo, apollo-hooks
Prisma Tools
Prisma tools to help you generate CRUD system for GraphQL servers
Stars: ✭ 237 (+507.69%)
Mutual labels:  apollo, graphql-server
graphql-spotify
GraphQL Schema And Resolvers For Spotify Web API
Stars: ✭ 55 (+41.03%)
Mutual labels:  graphql-server, dataloader
Workshop-GraphQL
A GraphQL Server made for the workshop
Stars: ✭ 22 (-43.59%)
Mutual labels:  graphql-server, dataloader
Graphql Modules
Enterprise Grade Tooling For Your GraphQL Server
Stars: ✭ 962 (+2366.67%)
Mutual labels:  apollo, graphql-server
Graphql Transform Schema
Transform, filter & alias resolvers of a GraphQL schema
Stars: ✭ 84 (+115.38%)
Mutual labels:  apollo, graphql-server
bookshelf
My GraphQL playground
Stars: ✭ 64 (+64.1%)
Mutual labels:  apollo, graphql-codegen
Heighliner
A GraphQL Server for NewSpring Web
Stars: ✭ 13 (-66.67%)
Mutual labels:  apollo, graphql-server
gitstar
Github Client built with React Apollo
Stars: ✭ 15 (-61.54%)
Mutual labels:  apollo
gitsearch
A searchbar for querying Github users and repositories. Written in React Native and React Native Web. GraphQL and Apollo Client to query Github GraphQL API.
Stars: ✭ 15 (-61.54%)
Mutual labels:  apollo
dgraph graphql go
A GraphQL + Dgraph + Go + HTTP based backend service demo.
Stars: ✭ 49 (+25.64%)
Mutual labels:  graphql-server
apollo-tracing-elixir
Apollo Tracing middleware for Absinthe
Stars: ✭ 114 (+192.31%)
Mutual labels:  apollo

GraphQL-Modules TypeScript Server & NextJS React application

Demonstration application for showcase utilizing Graphql-modules which is using data from BOL.com Open Api for the server (also complete mocked version is available). You will find a sample with products and dataloader. The React web application is using NextJS, GraphQL Codegen by Dotan and Apollo hooks. More background information about this app is in the wiki. I would like to thank The Guild for their awesome GraphQL toolchain.

PRE-REQUISITES

  • Node dubnium (required) or higher
  • Facebook watchman (only for development) (optional)
  • Get your free API key from open api bol.com (optional)

INSTALL

  1. yarn
  2. bash setup.sh sets correct local .env file for server part with mock mode as default (it is possible to set your bol.com api key there as well (then also set MOCK_API=off), the only difference will be using a real datasource or not!)
  3. Apollo vsc extension (optional)

ONLINE DEMO

Both Heroku containers spin down when no activity, please be patient. graphql-schiphol.herokuapp.com/ which points to the graphql endpoint at graphql-server - interactive graph.

STRUCTURE

.
├── /config/            # some configuration for build scripts
├── /packages/          # 2 applications
│   ├── /app/           # React NextJS isomorphic application
│   └── /server/        # Apollo GraphQL server created with graphql-modules
├── /test/              # end-to-end tests

DEVELOPMENT

Now when you followed the install part (and looked at point 2, its nicer with a real datasource) you can simply run yarn start. It will spin up the GraphQL server and the React application. Please look at the Vscode plugins below for editor happiness.

It is also possible to just play with only the server part with MOCK_API=on yarn start:dev:server, which spins up the graphql server in mocked mode. Or BOL_API_KEY=*** yarn start:dev:server which spins it up in non-mocked mode when you have an open api bol.com key.

For Vscode you can attach GRAPHQL server to the debug panel which will make it possible to have breakpoints while running the whole application. For other editors just whatch port 7001 for inspection results.

PLAYGROUND

At local-server or demo-server heroku you will see dataloader taking care of eventually requesting two products from the API in one single call. Using the following query:

{
  foo: getProduct(id:"9200000111963040") {
    id
    title
  }
  bar:getProduct(id:"9200000111963040") {
    id
    title
    rating
  }
  shizzle:getProduct(id:"9200000108695538") {
    title
    rating
    shortDescription
  }
}

You can find product and product category id's on the real bol.com website to play further.

CODE DEMONSTRATION

Product is explained in:

PRODUCTION

By default after install the build will take place. Please look carefully at ./packages/server/src/server.ts#37 and put comment back when really deploying for production, then you need to turn off introspection and interactive graph, they are now only turned on for the demonstration effect.

CONFIGURATION

Environment vars for development (set them in CI for production).

'.env' file inside './packages/server':

Important: You can set MOCK_API to 'on' in case you don't have access to bol.com api. Then the server will use stub data

BOL_API_KEY=***
NODE_ENV=development
MOCK_API=on|off
ENGINE_KEY=optional-apollo-engine-key-overhere REMOVE WHEN NOT AVAILABLE
ALLOWED_ORIGIN=optional-not-needed-dev-mode REMOVE

'.env' file inside './packages/app'

This file is optional, the dev setting is the default.

GRAPHQL_ENDPOINT=endpoint-your-graphql-server-will-run

TODO

  1. Add more tooling (things like storybook etc etc)
  2. yarn upgrade-interactive --latest
  3. ask apollo team if graphiql can be offline too, now it loads resources from cdn.jsdelivr.net

ARTICLES

NON-BELIEVERS

There are always teams resistent to pickup "new" technologies. If they want they are still able to consume us as rest endpoints with the same codebase behind it.

For example our application also gives the following endpoint: locally: /api/get-product/9200000111963040 or online demo

See open-api its auto generated with help of SOFA

VSC plugins

Codeship Status for maapteh/graphql-modules-app

This project is using Percy.io for visual regression testing.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].