mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 17:51:40 -05:00
go back to using es6 compile target
This commit is contained in:
parent
cc4fa17c50
commit
b3d4c05295
3 changed files with 9 additions and 9 deletions
|
@ -19,8 +19,6 @@ export interface GqlResponse {
|
||||||
errors?: Array<string>;
|
errors?: Array<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { Promise } from 'es6-promise';
|
|
||||||
|
|
||||||
export interface QueryOptions {
|
export interface QueryOptions {
|
||||||
schema: GraphQLSchema;
|
schema: GraphQLSchema;
|
||||||
query: string | Document;
|
query: string | Document;
|
||||||
|
|
|
@ -55,7 +55,10 @@ export function graphqlHTTP(options: ExpressApolloOptions | ExpressApolloOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: some sanity checks here.
|
// TODO: some sanity checks here.
|
||||||
let { query, variables, operationName } = req.body;
|
const b = req.body;
|
||||||
|
const query = b.query;
|
||||||
|
const operationName = b.operationName;
|
||||||
|
let variables = b.variables;
|
||||||
|
|
||||||
if (typeof variables === 'string') {
|
if (typeof variables === 'string') {
|
||||||
// TODO: catch errors
|
// TODO: catch errors
|
||||||
|
@ -98,11 +101,10 @@ function isOptionsFunction(arg: ExpressApolloOptions | ExpressApolloOptionsFunct
|
||||||
export function renderGraphiQL(options: GraphiQL.GraphiQLData) {
|
export function renderGraphiQL(options: GraphiQL.GraphiQLData) {
|
||||||
return (req: express.Request, res: express.Response, next) => {
|
return (req: express.Request, res: express.Response, next) => {
|
||||||
|
|
||||||
const {
|
const q = req.query;
|
||||||
query = '',
|
const query = q.query || '';
|
||||||
variables = '{}',
|
const variables = q.variables || '{}';
|
||||||
operationName = '',
|
const operationName = q.operationName || '';
|
||||||
} = req.query;
|
|
||||||
|
|
||||||
|
|
||||||
const graphiQLString = GraphiQL.renderGraphiQL({
|
const graphiQLString = GraphiQL.renderGraphiQL({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue