Skip to content

Commit

Permalink
Adjust #2028 for graphql@15.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser committed Aug 2, 2022
1 parent f15f6ea commit 770cd9c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions gateway-js/src/datasources/RemoteGraphQLDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,19 @@ export class RemoteGraphQLDataSource<
extensions.code = 'FORBIDDEN';
}

return new GraphQLError(`${response.status}: ${response.statusText}`, {
// Note: gateway 0.x still supports graphql-js v15.8, which does
// not have the options-based GraphQLError constructor. Note that
// the constructor used here is dropped in graphql-js v17, so this
// will have to be adjusted if we try to make gateway 0.x support
// graphql-js v17.
return new GraphQLError(
`${response.status}: ${response.statusText}`,
null,
null,
null,
null,
null,
extensions,
});
);
}
}

0 comments on commit 770cd9c

Please sign in to comment.