
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
gqlx-apollo-express-server
Advanced tools
A Node.js Express middleware for integrating an Apollo server supporting gqlx.
An opinionated Express middleware bringing a pre-configured Apollo server with gqlx support to your project.

To get started just install the package via npm.
npm i gqlx-apollo-express-server
Since Express is used as a peer dependency you need to have it installed already or you'll need to install it.
import * as express from 'express';
import { configureGqlx, createServices } from 'gqlx-apollo-express-server';
const port = +(process.env.PORT || 3000);
const app = express();
const gqlxServer = configureGqlx({
port,
host: 'http://www.example.com',
services: createServices([
{
name: 'default',
source: `
type Query {
hello(name: String): String {
name ? 'Hello ' + name : 'Hello World'
}
}
`,
data: {},
},
]),
});
gqlxServer.applyMiddleware(app);
app.listen(port);
The gqlx-apollo-express-server is service-based, i.e., we have to supply services for performing the GraphQL resolver duty. The advantage is that we can easily swap services during runtime, e.g., if these services relate to independent functionality such as microservices which are updated during we can reflect these updates in the GraphQL instance as well - without having to restart the server.
A Node.js Express middleware for integrating an Apollo server supporting gqlx.
All you need is to use the configureGqlx method for configuring everything you need. The object is ready to be used on an express application. It will install multiple middlewares (depending on the configuration) to serve GraphQL (and potentially some other stuff, such as an GraphiQL instance).
// ...
import { configureGqlx } from 'gqlx-apollo-express-server';
const app = express();
configureGqlx({ port, /* ... */ }).applyMiddleware(app);
Right now the following options are supported:
interface GatewayOptions<TApi, TData> {
/**
* The port of the server.
*/
port: number;
/**
* The (external) hostname for lookups.
*/
host: string;
/**
* The different services to register.
*/
services: Array<Service<TApi, TData>>;
/**
* The optional keep alive in milliseconds.
*/
keepAlive?: number;
/**
* Activates the optional tracing.
*/
tracing?: boolean;
/**
* Activates the optional cache-control.
*/
cacheControl?: boolean;
/**
* Optionally, sets the max. size of a file (in bytes).
*/
maxFileSize?: number;
/**
* Optionally, sets the max. number of files to upload.
*/
maxFiles?: number;
/**
* Defines an error formatter.
* @param error The error to format.
* @returns The formatted error message.
*/
formatter?(error?: string): any;
/**
* Creates the API to be used by the services.
*/
createApi?: ApiCreator<TApi, TData>;
/**
* Optionally, changes the used server paths.
*/
paths?: ServerPaths;
}
Only the first three (port, host, and services) are required.
We are totally open for contribution and appreciate any feedback, bug reports, or feature requests. More detailed information on contributing incl. a code of conduct are soon to be presented.
What needs to be configured?
Only a bare minimum of configuration is necessary. The getting started contains a sample using only the required options. What services to expose and how these are defined is fully up to you.
This project adheres to semantic versioning.
You can find the changelog in the CHANGELOG.md file.
gqlx-apollo-express-server is released using the MIT license. For more information see the LICENSE file.
FAQs
A Node.js Express middleware for integrating an Apollo server supporting gqlx.
We found that gqlx-apollo-express-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.