Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions spec/ParseGraphQLServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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' });
Expand Down
1 change: 1 addition & 0 deletions src/GraphQL/ParseGraphQLServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ParseGraphQLServer {
config,
auth,
}),
maskedErrors: false,
multipart: {
fileSize: this._transformMaxUploadSizeToBytes(
this.parseServer.config.maxUploadSize || '20mb'
Expand Down