Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-server-micro

Package Overview
Dependencies
Maintainers
4
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-server-micro - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

10

package.json
{
"name": "apollo-server-micro",
"version": "1.2.0",
"version": "1.3.0",
"description": "Production-ready Node.js GraphQL server for Micro",

@@ -28,4 +28,4 @@ "main": "dist/index.js",

"dependencies": {
"apollo-server-core": "^1.2.0",
"apollo-server-module-graphiql": "^1.2.0"
"apollo-server-core": "^1.3.0",
"apollo-server-module-graphiql": "^1.3.0"
},

@@ -35,3 +35,3 @@ "devDependencies": {

"@types/micro": "7.3.1",
"apollo-server-integration-testsuite": "^1.2.0",
"apollo-server-integration-testsuite": "^1.3.0",
"micro": "8.0.4",

@@ -41,3 +41,3 @@ "microrouter": "2.2.3"

"peerDependencies": {
"micro": "^8.0.1"
"micro": "^8.0.1 || ^9.0.1"
},

@@ -44,0 +44,0 @@ "typings": "dist/index.d.ts",

@@ -1,23 +0,32 @@

# graphql-server-micro
---
title: Micro
description: Setting up Apollo Server with Micro
---
This is the [Micro](https://github.com/zeit/micro) integration for the Apollo community GraphQL Server. [Read the docs.](http://dev.apollodata.com/tools/apollo-server/index.html)
[![npm version](https://badge.fury.io/js/apollo-server-core.svg)](https://badge.fury.io/js/apollo-server-core) [![Build Status](https://travis-ci.org/apollographql/apollo-server.svg?branch=master)](https://travis-ci.org/apollographql/apollo-server) [![Coverage Status](https://coveralls.io/repos/github/apollographql/apollo-server/badge.svg?branch=master)](https://coveralls.io/github/apollographql/apollo-server?branch=master) [![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://www.apollographql.com/#slack)
This is the [Micro](https://github.com/zeit/micro) integration for the Apollo community GraphQL Server. [Read the docs.](https://www.apollographql.com/docs/apollo-server/)
```sh
npm install apollo-server-micro
```
## Example
```typescript
import { microGraphiql, microGraphql } from "graphql-server-micro";
import micro, { send } from "micro";
import { get, post, router } from "microrouter";
import schema from "./schema";
```js
import { microGraphiql, microGraphql } from 'apollo-server-micro';
import micro, { send } from 'micro';
import { get, post, router } from 'microrouter';
import schema from './schema';
const graphqlHandler = microGraphql({ schema });
const graphiqlHandler = microGraphiql({ endpointURL: "/graphql" });
const graphiqlHandler = microGraphiql({ endpointURL: '/graphql' });
const server = micro(
router(
get("/graphql", graphqlHandler),
post("/graphql", graphqlHandler),
get("/graphiql", graphiqlHandler),
(req, res) => send(res, 404, "not found"),
),
get('/graphql', graphqlHandler),
post('/graphql', graphqlHandler),
get('/graphiql', graphiqlHandler),
(req, res) => send(res, 404, 'not found')
)
);

@@ -24,0 +33,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc