GraphQL: Optimize queries, fixes some null returns (on object), fix stitched GraphQLUpload (#6709)
* Optimize query, fixes some null returns, fix stitched GraphQLUpload * Fix authData key selection * Prefer Iso string since other GraphQL solutions use this format * fix tests Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
GraphQLUnionType,
|
||||
} from 'graphql';
|
||||
import { toGlobalId } from 'graphql-relay';
|
||||
import { GraphQLUpload } from 'graphql-upload';
|
||||
import { GraphQLUpload } from '@graphql-tools/links';
|
||||
|
||||
class TypeValidationError extends Error {
|
||||
constructor(value, type) {
|
||||
@@ -162,7 +162,7 @@ const serializeDateIso = (value) => {
|
||||
return value;
|
||||
}
|
||||
if (value instanceof Date) {
|
||||
return value.toUTCString();
|
||||
return value.toISOString();
|
||||
}
|
||||
|
||||
throw new TypeValidationError(value, 'Date');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { GraphQLNonNull } from 'graphql';
|
||||
import { mutationWithClientMutationId } from 'graphql-relay';
|
||||
import { GraphQLUpload } from 'graphql-upload';
|
||||
import { GraphQLUpload } from '@graphql-tools/links';
|
||||
import Parse from 'parse/node';
|
||||
import * as defaultGraphQLTypes from './defaultGraphQLTypes';
|
||||
import logger from '../../logger';
|
||||
@@ -14,7 +14,7 @@ const handleUpload = async (upload, config) => {
|
||||
const chunks = [];
|
||||
stream
|
||||
.on('error', reject)
|
||||
.on('data', chunk => chunks.push(chunk))
|
||||
.on('data', (chunk) => chunks.push(chunk))
|
||||
.on('end', () => resolve(Buffer.concat(chunks)));
|
||||
});
|
||||
}
|
||||
@@ -52,7 +52,7 @@ const handleUpload = async (upload, config) => {
|
||||
}
|
||||
};
|
||||
|
||||
const load = parseGraphQLSchema => {
|
||||
const load = (parseGraphQLSchema) => {
|
||||
const createMutation = mutationWithClientMutationId({
|
||||
name: 'CreateFile',
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user