From 1cfe2839265983030c4f8b20198134e2408e7787 Mon Sep 17 00:00:00 2001 From: Nick Nance Date: Tue, 2 Aug 2016 10:04:15 -0700 Subject: [PATCH] update TypeScript dependencies and documentation (#74) * update TypeScript dependencies and documentation * update typescript documentation --- README.md | 10 ++++++++++ src/index.ts | 2 ++ typings.json | 10 +++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 82ba4d7c..4f908534 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,15 @@ Anyone is welcome to contribute to Apollo Server, just read [CONTRIBUTING.md](./ Apollo Server is super-easy to set up. Just npm-install apollo-server, write a GraphQL schema, and then use one of the following snippets to get started. For more info, read the [Apollo Server docs](http://docs.apollostack.com/apollo-server). +### TypeScript + +If you want to build your GraphQL server using TypeScript, Apollo Server is the project for you. + +```sh +npm install apollo-server +typings i -SG dt~express dt~express-serve-static-core dt~serve-static dt~mime dt~hapi dt~cookies dt~koa +``` + ### Express ```js @@ -114,6 +123,7 @@ Apollo Server and express-graphql are more or less the same thing (GraphQL middl * Compared to express-graphql, Apollo Server has a simpler interface and supports exactly one way of passing queries. * Apollo Server separates serving GraphiQL (GraphQL UI) from responding to GraphQL requests. * express-graphql contains code for parsing HTTP request bodies, Apollo Server leaves that to standard packages like body-parser. +* Built with TypeScript Despite express-graphql being a reference implementation, Apollo Server is actually easier to understand and more modular than express-graphql. diff --git a/src/index.ts b/src/index.ts index a4b826fd..5749d515 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +export { runQuery } from './core/runQuery' +export { renderGraphiQL} from './modules/renderGraphiQL' export { apolloExpress, graphiqlExpress } from './integrations/expressApollo'; export { ApolloHAPI, GraphiQLHAPI } from './integrations/hapiApollo'; export { apolloKoa, graphiqlKoa } from './integrations/koaApollo'; diff --git a/typings.json b/typings.json index dcbc724f..6a9ad0e9 100644 --- a/typings.json +++ b/typings.json @@ -1,13 +1,13 @@ { "dependencies": { - "chai": "registry:npm/chai#3.5.0+20160415060238", + "chai": "registry:npm/chai#3.5.0+20160723033700", "graphql": "github:nitintutlani/typed-graphql#ffe7e46e2249cc8f3824a5d15a44938f4354afe9", - "http-errors": "registry:npm/http-errors#1.4.0+20160305200728" + "http-errors": "registry:npm/http-errors#1.4.0+20160723033700" }, "globalDependencies": { "body-parser": "registry:dt/body-parser#0.0.0+20160619023215", - "cookies": "registry:dt/cookies#0.5.1+20160316171810", "connect": "registry:dt/connect#3.4.0+20160317120654", + "cookies": "registry:dt/cookies#0.5.1+20160316171810", "express": "registry:dt/express#4.0.0+20160708185218", "express-serve-static-core": "registry:dt/express-serve-static-core#4.0.0+20160715232503", "hapi": "registry:dt/hapi#13.0.0+20160709092105", @@ -16,8 +16,8 @@ "koa-router": "registry:dt/koa-router#7.0.0+20160314083221", "mime": "registry:dt/mime#0.0.0+20160316155526", "mocha": "registry:dt/mocha#2.2.5+20160720003353", - "multer": "registry:dt/multer#0.0.0+20160317120654", - "node": "registry:dt/node#6.0.0+20160720070758", + "multer": "registry:dt/multer#0.0.0+20160726135055", + "node": "registry:dt/node#6.0.0+20160801161248", "serve-static": "registry:dt/serve-static#0.0.0+20160606155157" } }