We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 901ffef commit f13b62cCopy full SHA for f13b62c
projects/graphql-client/src/graphql-request.service.ts
@@ -167,7 +167,15 @@ export class GraphQlRequestService {
167
.mutate<TResponse>({
168
mutation: gql(`mutation ${requestString}`)
169
})
170
- .pipe(mergeMap(response => (response.data ? of(response.data) : EMPTY)));
+ .pipe(
171
+ tap(response => {
172
+ if (!isNil(response.errors)) {
173
+ // tslint:disable-next-line: no-console
174
+ console.error(`Mutation response error(s) for request '${requestString}'`, response.errors);
175
+ }
176
+ }),
177
+ mergeMap(response => (response.data ? of(response.data) : EMPTY))
178
+ );
179
}
180
181
private getResultForRequest<T>(request: GraphQlRequest): Observable<T> {
0 commit comments