项目作者: Krina28

项目描述 :
GraphQL Query in NodeJS
高级语言: JavaScript
项目地址: git://github.com/Krina28/graphql-demo.git
创建时间: 2019-06-16T08:47:24Z
项目社区:https://github.com/Krina28/graphql-demo

开源协议:

下载


GraphQL Demo in Nodejs with MongoDB

Dependency

Node version : Node v6

NPM version : npm v5

Installation

npm install apollo-server-express graphql graphql-tools express mongoose --save

GraphiQL Playground

  • Add playground: true to server creation script and that will allow to open graghiql playground while running the query.

Example

  1. var express = require('express');
  2. var { ApolloServer } = require('apollo-server-express');
  3. var typeDefs = require('./src/graphql/schema')
  4. var resolvers = require('./src/graphql/resolver')
  5. require('./src/config/index');
  6. const app = express();
  7. const server = new ApolloServer({ typeDefs, resolvers, playground: true, });
  8. server.applyMiddleware({ app, path: '/graphql' });
  9. app.listen({ port: 3000 }, function () {
  10. console.log('Server started...')
  11. })

Features

  • Grahql Apollo Express Server Integration
  • Schema & Resolvers Implementation
  • Saclar Type Implementation
  • Queries & Examples

Dependencies

  • express - For Express Server
  • bcrypt - For Encyption
  • body-parser - For parsing
  • graphql - For Query API
  • mongoose - To manage relationships with data and schema for MongoDB
  • apollo-server-express - For Graphql Connection with Express Server

Feel free to reach out through LinkedIn or Stack overflow !!

https://www.linkedin.com/in/krina-soni-b840676b

https://stackoverflow.com/users/8880590/krina-soni