fix: errors in GraphQL do not show the original error but a general Unexpected Error (#8045)
This commit is contained in:
@@ -10646,6 +10646,12 @@ describe('ParseGraphQLServer', () => {
|
||||
},
|
||||
resolve: (p, { message }) => message,
|
||||
},
|
||||
errorQuery: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
resolve: () => {
|
||||
throw new Error('A test error');
|
||||
},
|
||||
},
|
||||
customQueryWithAutoTypeReturn: {
|
||||
type: SomeClassType,
|
||||
args: {
|
||||
@@ -10734,6 +10740,18 @@ describe('ParseGraphQLServer', () => {
|
||||
expect(result.data.customQuery).toEqual('hello');
|
||||
});
|
||||
|
||||
it('can forward original error of a custom query', async () => {
|
||||
await expectAsync(
|
||||
apolloClient.query({
|
||||
query: gql`
|
||||
query ErrorQuery {
|
||||
errorQuery
|
||||
}
|
||||
`,
|
||||
})
|
||||
).toBeRejectedWithError('A test error');
|
||||
});
|
||||
|
||||
it('can resolve a custom query with auto type return', async () => {
|
||||
const obj = new Parse.Object('SomeClass');
|
||||
await obj.save({ name: 'aname', type: 'robot' });
|
||||
|
||||
@@ -38,6 +38,7 @@ class ParseGraphQLServer {
|
||||
config,
|
||||
auth,
|
||||
}),
|
||||
maskedErrors: false,
|
||||
multipart: {
|
||||
fileSize: this._transformMaxUploadSizeToBytes(
|
||||
this.parseServer.config.maxUploadSize || '20mb'
|
||||
|
||||
Reference in New Issue
Block a user