apollo-socket-network-interface-server

0.1.15 • Public • Published

Apollo Socket Network Interface (Server)

Apollo-GraphQL network interface for sockets.

Enables high-performance communication without the overhead of HTTP.

Example

import createServer from 'apollo-socket-network-interface-server';
import { makeExecutableSchema } from 'graphql-tools';
import typeDefs from './typeDefs';
import resolvers from './resolvers';
 
// http://dev.apollodata.com/tools/graphql-tools/generate-schema.html#makeExecutableSchema
let schema = makeExecutableSchema({
    typeDefs: typeDefs,
    resolvers: resolvers,
});
 
let sockServer = createServer({
    path: '/tmp/redspider-graphql.sock',
    schema: schema,
});
 
['SIGTERM','SIGINT'].forEach(signal => process.on(signal, () => {
    // shut the server down cleanly
    sockServer.close();
    process.exit();
}));

License

MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i apollo-socket-network-interface-server

Weekly Downloads

0

Version

0.1.15

License

MIT

Last publish

Collaborators

  • mglamuzina
  • cbucholz
  • ejackisch
  • mnpenner
  • sramage