A HarperDB Component for running and developing Apollo GraphQL backend services.
Most Apollo features are supported as this component relies on the ApolloServer
provided by @apollo/server
.
All configuration options are optional
Specify a path to a custom Apollo cache implementation.
Must be set to a path of a JavaScript file with a default export of an Apollo cache backend implementing the KeyValueCache
interface.
For example:
class CustomCache {
// ...
}
export default CustomCache;
Specify a port for the Apollo server. Defaults to the HarperDB default port (generally 9926
).
Specify a path to the Apollo resolvers JavaScript file.
Must be set to a singular path of a JavaScript file containing a default export of Apollo resolver functions.
For example:
const resolvers = {
Query: {
dog: //...
},
}
export default resolvers;
Specify a glob path to Apollo schema files.
Can be a singular path or a glob pattern. All schemas will be concatenated together and passed to the Apollo server.
For example, if all schemas are located in src/schemas/
, the setting here would be ./src/schemas/*.graphql
Specify a secure port for the Apollo server. Defaults to the HarperDB default secure port.