apollo-starter
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Apollo GraphQL Starter

A library that starts an Apollo Subgraph which attempts to load typeDefs, resolvers and dataSources from the homonymous subdirectories in a path provided as a parameter.

The subgraph will also try to load environment variables and integrate to Sentry. For this it uses the Apollo Sentry Plugin.

Why?

Because if you're going to create several Apollo Subgraph projects, it simplifies things when you known they're all created equal. Meaning that for each subgraph you only have to worry about the actual types, resolvers and data sources, while you can rest easy that they all work the same way, evolve based on the same shared code and are instrumented with the same integrations.

Usage

index.js

import { startApolloSubgraphFromPath } from 'apollo-starter'
const serverPromise = startApolloSubgraphFromPath({
	title: 'My Subgraph',
	port: 4000,
	relPath: './path/to/'
})

Will expect to load the subgraph's typeDefs, resolvers and dataSources from the following structure.

├── index.js
└── path
	└──to
		├── dataSources
		│   └── ...
		├── resolvers
		│   └── ...
		└── typeDefs
			└── ...

Package Sidebar

Install

npm i apollo-starter

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

27.8 kB

Total Files

38

Last publish

Collaborators

  • mig82