-
Notifications
You must be signed in to change notification settings - Fork 122
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
How to make calls to arbitrary URLs? #192
Comments
Thanks for reporting this @timhwang21 This is definitely a bug that was introduced about a year ago. I guess many people configure their "base endpoints" once for the whole RestLink, so I guess people weren't using this feature very much. -- Suppressing this warning and restoring support for full-urls in the I would support helping review a PR if anyone wants to contribute the fix. |
Awesome, I can take a crack over the weekend. @fbartho do you have any pointers as to which part of the codebase I should start looking at first? Thanks. |
@timhwang21 Unfortunately, we really only have one source-file in the codebase, it's not incredibly long, but I expect you'd need to change several places throughout the file. |
I ran into this and would find value in allowing a full url in the path or another option to define a new url, like @timhwang21 were you able to whip something up? Fwiw here is a little work around I did to get it to work in the meantime.
Thats pretty much it. |
I have not, we ended up migrating our rest service to GraphQL.
…On Mon, Jul 22, 2019 at 9:14 AM Mat Silva ***@***.***> wrote:
I ran into this and would find value in allowing a full url in the path or
another option to define a new url, like url: "
https://domain.com/api/path/1".
@timhwang21 <https://github.com/timhwang21> were you able to whip
something up?
Fwiw here is a little work around I did to get it to work in the meantime.
1. Specify an empty endpoint in the config. Note there is an actual
space in the value empty: ' '.
[image: image]
<https://user-images.githubusercontent.com/4511972/61635093-c85eba80-ac60-11e9-87aa-eae6cf788e59.png>
2. Use this as the endpoint in your query, here is an example of
resolving waterfall requests...
[image: image]
<https://user-images.githubusercontent.com/4511972/61635160-f0e6b480-ac60-11e9-8879-e78f0ae4d982.png>
Thats pretty much it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#192?email_source=notifications&email_token=ABMPWCWNFOUEL4WFA3GSY7TQAWXEZA5CNFSM4GX3BPZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2P4BCQ#issuecomment-513785994>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABMPWCVPMVEBZQSMS2CGQQLQAWXEZANCNFSM4GX3BPZQ>
.
|
yup that'll work too 😁 |
Ran into this issue when consuming a mix of Github's API, some of which isn't in their GraphQL API yet. Their Rest API has a lot of absolute URL fields that I'd be able to export and reuse, however the |
If somebody wants to implement this, I'm still happy to review the PR w/ Tests & Documentation! |
Hi,
Is there any way to call arbitrary URLs in queries?
The docs say that
path
in the@rest
directive can take a path or a full URL. However, when passing the following query, I get errors:When I then pass
path="${encodeURIComponent('https://foo.com/foo')}"
, REST link tries to hithttps://[my current url]https%3A%2F%2Ffoo.com%2Ffoo
.pathBuilder
similarly appends my built path to my original URL.Is the only option register every URL your app will call in the REST link setup? If so I think the docs should be updated to reflect
path
not taking full URLs.The text was updated successfully, but these errors were encountered: