Skip to content

Commit

Permalink
feat: use operation name if ID not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed Nov 8, 2017
1 parent c5417c3 commit 4297e4e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/RelayRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,8 @@ export default class RelayRequest {
});
}

getDebugName(): string {
// TODO
return 'req.relayReqId';
}

getID(): string {
return this.id;
return this.id || this.operation.name;
}

_generateID(): string {
Expand Down
4 changes: 0 additions & 4 deletions src/RelayRequestBatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ export default class RelayRequestBatch {
};
}

getDebugName(): string {
return `BATCH_QUERY:${this.getID()}`;
}

getBody(): string {
if (!this.fetchOpts.body) {
this.fetchOpts.body = this.prepareBody();
Expand Down
2 changes: 1 addition & 1 deletion src/createRequestError.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function createRequestError(req: RelayRequestAny, res?: RelayResponse) {
}

const error = new RRNLRequestError(
`Relay request for \`${req.getDebugName()}\` failed by the following reasons:\n\n${errorReason}`
`Relay request for \`${req.getID()}\` failed by the following reasons:\n\n${errorReason}`
);

error.req = req;
Expand Down

0 comments on commit 4297e4e

Please sign in to comment.