Skip to content

Commit e452d50

Browse files
committed
fix: graphql masked errors
1 parent 72fac8a commit e452d50

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

spec/ParseGraphQLServer.spec.js

+18
Original file line numberDiff line numberDiff line change
@@ -10646,6 +10646,12 @@ describe('ParseGraphQLServer', () => {
1064610646
},
1064710647
resolve: (p, { message }) => message,
1064810648
},
10649+
errorQuery: {
10650+
type: new GraphQLNonNull(GraphQLString),
10651+
resolve: () => {
10652+
throw new Error('A test error');
10653+
},
10654+
},
1064910655
customQueryWithAutoTypeReturn: {
1065010656
type: SomeClassType,
1065110657
args: {
@@ -10734,6 +10740,18 @@ describe('ParseGraphQLServer', () => {
1073410740
expect(result.data.customQuery).toEqual('hello');
1073510741
});
1073610742

10743+
it('can forward original error of a custom query', async () => {
10744+
await expectAsync(
10745+
apolloClient.query({
10746+
query: gql`
10747+
query ErrorQuery {
10748+
errorQuery
10749+
}
10750+
`,
10751+
})
10752+
).toBeRejectedWithError('A test error');
10753+
});
10754+
1073710755
it('can resolve a custom query with auto type return', async () => {
1073810756
const obj = new Parse.Object('SomeClass');
1073910757
await obj.save({ name: 'aname', type: 'robot' });

src/GraphQL/ParseGraphQLServer.js

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class ParseGraphQLServer {
3838
config,
3939
auth,
4040
}),
41+
maskedErrors: false,
4142
multipart: {
4243
fileSize: this._transformMaxUploadSizeToBytes(
4344
this.parseServer.config.maxUploadSize || '20mb'

0 commit comments

Comments
 (0)