Skip to content

Commit

Permalink
fix: use getContext
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Mar 10, 2020
1 parent 190608f commit bff2abe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
17 changes: 0 additions & 17 deletions example/__tests__/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,4 @@ describe('AppModule', () => {
]
`);
});

it('/graphql(POST) forbiddenException', async () => {
const { query } = apolloClient;
const result = await query({
query: gql`
query {
forbiddenException
}
`,
variables: {},
});
expect(result.errors).toMatchInlineSnapshot(`
Array [
[GraphQLError: [object Object]],
]
`);
});
});
3 changes: 2 additions & 1 deletion lib/raven.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ export class RavenInterceptor implements NestInterceptor {
gqlHost: GraphQLArgumentsHost,
exception,
): void {
const context = gqlHost.getContext();
// Same as HttpException
const data = Handlers.parseRequest(
<any>{},
gqlHost.getContext(),
context?.req || context,
this.options,
);
scope.setExtra('req', data.request);
Expand Down

0 comments on commit bff2abe

Please sign in to comment.