Run npm install @mvf/servicer-apollo
Set the following environment variables in your project
-
ENVIRONMENT_FILE
should be set to one ofdevelopment
|testing
|staging
|production
-
APOLLO_SERVER_PORT
defaults to 80
To setup Servicer Apollo you will need an entrypoint.ts or equivalent file.
import { Application, DaemonCommand } from "@mvf/servicer";
import { Apollo, Resolvers, IApolloConfig } from "@mvf/servicer-apollo";
import { ApolloEventSources } from "EventSources";
import schema, { actionResolvers, dataSources, graphqlResolvers } from "Services/Apollo";
import { verifyToken } from "Services/Middleware/Auth/Auth";
const environmentConfig: IApolloConfig = process.env.ENVIRONMENT_FILE === "development" ? {
playground: true,
introspection: true,
} : {};
const config: IApolloConfig = {
context: verifyToken,
dataSources,
...environmentConfig,
};
const setupApplication = async () => {
const application = new Application();
const resolvers = new Resolvers(ApolloEventSources, actionResolvers(), graphqlResolvers());
application.addCommands(
new DaemonCommand(new Apollo(resolvers, schema, config)),
);
await application.run();
};
setupApplication();
- Run
make
to build the container - Run
make shell
to enter the container - Run
npm install
to install dependencies
Refer to package.json for commands
After you have merged a PR to master, you need to rebuild and publish your changes.
- Checkout master
git checkout master && git pull
- Use one of the following make publish commands to publish changes:
-
make publish kind=patch
- Use this if your change is a bug fix and is backwards compatible. -
make publish kind=minor
- Use this if your change adds new functionality and is backwards compatible. -
make publish kind=major
- Use this if your change is not backwards compatible.
-