mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41: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>;
|
||||
}
|
||||
|
||||
import { Promise } from 'es6-promise';
|
||||
|
||||
export interface QueryOptions {
|
||||
schema: GraphQLSchema;
|
||||
query: string | Document;
|
||||
|
|
|
@ -55,7 +55,10 @@ export function graphqlHTTP(options: ExpressApolloOptions | ExpressApolloOptions
|
|||
}
|
||||
|
||||
// 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') {
|
||||
// TODO: catch errors
|
||||
|
@ -98,11 +101,10 @@ function isOptionsFunction(arg: ExpressApolloOptions | ExpressApolloOptionsFunct
|
|||
export function renderGraphiQL(options: GraphiQL.GraphiQLData) {
|
||||
return (req: express.Request, res: express.Response, next) => {
|
||||
|
||||
const {
|
||||
query = '',
|
||||
variables = '{}',
|
||||
operationName = '',
|
||||
} = req.query;
|
||||
const q = req.query;
|
||||
const query = q.query || '';
|
||||
const variables = q.variables || '{}';
|
||||
const operationName = q.operationName || '';
|
||||
|
||||
|
||||
const graphiQLString = GraphiQL.renderGraphiQL({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
|
|
Loading…
Add table
Reference in a new issue