create-graphql-service
v1.0.2
Published
Create a [GraphQL Federation](https://www.apollographql.com/docs/apollo-server/federation/introduction/) without configurations.
Downloads
4
Readme
Create GraphQL Service
Create a GraphQL Federation without configurations.
Stack
Get started
- Install globally
npm install -g create-graphql-service
- 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
- 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