-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo-datasource-rest URL not defined #1508
Comments
Are you importing from const { RESTDataSource } = require("apollo-datasource-rest") I had just imported and tested the linked example below and it worked in my node environment. Not sure if an issue, but did you try with a forward slash in front of async getDogs() {
return this.get(`/dogs`);
} here's a working example |
Hi @sbrichardson thanks for getting back. I suspect it is Babel that is messing with the imports. I created a repo here to reproduce the issue. |
I fixed it and created a pull request https://github.com/seanli3/apoll-datasource-rest-bug-report/pull/1 There were a few issues
|
This issue can be closed |
Thanks you very much @sbrichardson The PR did fix my issue. I didn't realize |
Hi, I'm trying to wrap around existing REST endpoints with datasource-rest
2.0.0-rc.5
.I got he following error
I looked at line 102 of
RESTDataSource.ts
and it looks like URL has not been imported correctly fromapollo-server-env
.And here is my code
I'm using babel7 with node 8.9.4
The text was updated successfully, but these errors were encountered: