1.0.2 • Published 4 years ago

create-graphql-service v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Create GraphQL Service

Create a GraphQL Federation without configurations.

Stack

  1. Install globally

    npm install -g create-graphql-service
  2. Create your service

    npx create-graphql-service my-graphql-service-name
    
    // You'll be asked to fill the package.json prompt (as you do after running "npm init")
    // Packages will be installed automatically and initial code scaffolding will be created
  3. Then you can finally start your service by running

    cd my-graphql-service-name
    
    // npm start:dev will add "development" as global variable
    npm run start:dev

Then open http://localhost:3000/graphql to see and test your new service on GraphQL Playground.

Folder structure

src/
├── index.js              # App entry-point (starts server)
├── server.js             # Fastify instantiation
│
├── api
│   ├── example           # Example of an API entity folder
│   │   ├── index.js
│   │   └── resolver.js
│   └── index.js          # API entry-point (this file exports ALL API resolvers and TypeDefs)
│
├── plugins               # Fastify plugins
│   └── apollo-server.js
│
└── schema                # Schemas entry-point (exports a GraphQL Federated Schema)
    └── index.js