apollo-server-micro
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15318
36
+ Addedarg@4.1.0(transitive)
+ Addedbytes@3.1.0(transitive)
+ Addedcontent-type@1.0.4(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addedhttp-errors@1.7.3(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedmicro@9.4.1(transitive)
+ Addedraw-body@2.4.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsetprototypeof@1.1.1(transitive)
+ Addedtoidentifier@1.0.0(transitive)
- Removedbytes@2.5.0(transitive)
- Removeddepd@1.1.0(transitive)
- Removedhttp-errors@1.6.1(transitive)
- Removediconv-lite@0.4.18(transitive)
- Removedinherits@2.0.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmicro@8.0.4(transitive)
- Removedmri@1.1.0(transitive)
- Removedraw-body@2.3.0(transitive)
- Removedsetprototypeof@1.0.3(transitive)
Updatedapollo-server-core@^1.3.0