diff --git a/CHANGELOG.md b/CHANGELOG.md index ea32790a9e8..d60120bfe6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### VNEXT +* Restify: Fix for calling next() (([@jadkap](https://github.com/jadkap)) on [#285](https://github.com/apollostack/graphql-server/pull/285)) +* Add AWS Lambda Integration [#101](https://github.com/apollostack/graphql-server/issues/101) * Restify: Fix for calling next() ([@jadkap](https://github.com/jadkap)) on [#285](https://github.com/apollostack/graphql-server/pull/285) * Update GraphiQL to version 0.9.1 ([@ephemer](https://github.com/ephemer)) on [#293](https://github.com/apollostack/graphql-server/pull/293) * Add AWS Lambda Integration [#101](https://github.com/apollostack/graphql-server/issues/101) diff --git a/packages/graphql-server-express/src/expressApollo.ts b/packages/graphql-server-express/src/expressApollo.ts index d3ed376f9fd..b095a9f1405 100644 --- a/packages/graphql-server-express/src/expressApollo.ts +++ b/packages/graphql-server-express/src/expressApollo.ts @@ -72,6 +72,7 @@ export function graphiqlExpress(options: GraphiQL.GraphiQLData) { const graphiQLString = GraphiQL.renderGraphiQL({ endpointURL: options.endpointURL, + subscriptionsEndpoint: options.subscriptionsEndpoint, query: query || options.query, variables: q.variables && JSON.parse(q.variables) || options.variables, operationName: operationName || options.operationName, diff --git a/packages/graphql-server-hapi/src/hapiApollo.ts b/packages/graphql-server-hapi/src/hapiApollo.ts index 84cd4dc470e..4a5e7369bff 100644 --- a/packages/graphql-server-hapi/src/hapiApollo.ts +++ b/packages/graphql-server-hapi/src/hapiApollo.ts @@ -121,6 +121,7 @@ function renderGraphiQL(route, graphiqlParams: any, reply) { const graphiqlOptions = route.settings.plugins['graphiql']; const graphiQLString = GraphiQL.renderGraphiQL({ endpointURL: graphiqlOptions.endpointURL, + subscriptionsEndpoint: graphiqlOptions.subscriptionsEndpoint, query: graphiqlParams.query || graphiqlOptions.query, variables: graphiqlParams.variables && JSON.parse(graphiqlParams.variables) || graphiqlOptions.variables, operationName: graphiqlParams.operationName || graphiqlOptions.operationName, diff --git a/packages/graphql-server-koa/src/koaApollo.ts b/packages/graphql-server-koa/src/koaApollo.ts index 3bdeab0e901..ca19505c4d6 100644 --- a/packages/graphql-server-koa/src/koaApollo.ts +++ b/packages/graphql-server-koa/src/koaApollo.ts @@ -53,6 +53,7 @@ export function graphiqlKoa(options: GraphiQL.GraphiQLData) { const graphiQLString = GraphiQL.renderGraphiQL({ endpointURL: options.endpointURL, + subscriptionsEndpoint: options.subscriptionsEndpoint, query: query || options.query, variables: q.variables && JSON.parse(q.variables) || options.variables, operationName: operationName || options.operationName, diff --git a/packages/graphql-server-lambda/src/lambdaApollo.ts b/packages/graphql-server-lambda/src/lambdaApollo.ts index 21e4d012e55..a962edbd974 100755 --- a/packages/graphql-server-lambda/src/lambdaApollo.ts +++ b/packages/graphql-server-lambda/src/lambdaApollo.ts @@ -87,6 +87,7 @@ export function graphiqlLambda(options: GraphiQL.GraphiQLData) { const graphiQLString = GraphiQL.renderGraphiQL({ endpointURL: options.endpointURL, + subscriptionsEndpoint: options.subscriptionsEndpoint, query: query || options.query, variables: q.variables && JSON.parse(variables) || options.variables, operationName: operationName || options.operationName, diff --git a/packages/graphql-server-module-graphiql/src/renderGraphiQL.ts b/packages/graphql-server-module-graphiql/src/renderGraphiQL.ts index 62ef287078e..06ed2f64881 100644 --- a/packages/graphql-server-module-graphiql/src/renderGraphiQL.ts +++ b/packages/graphql-server-module-graphiql/src/renderGraphiQL.ts @@ -20,6 +20,7 @@ export type GraphiQLData = { endpointURL: string, + subscriptionsEndpoint?: string, query?: string, variables?: Object, operationName?: string, @@ -38,6 +39,8 @@ function safeSerialize(data) { export function renderGraphiQL(data: GraphiQLData): string { const endpointURL = data.endpointURL; + const subscriptionsEndpoint = data.subscriptionsEndpoint; + const usingSubscriptions = !!subscriptionsEndpoint; const queryString = data.query; const variablesString = data.variables ? JSON.stringify(data.variables, null, 2) : null; @@ -66,6 +69,10 @@ export function renderGraphiQL(data: GraphiQLData): string { + ${usingSubscriptions ? + '' + + '' + : ''}