Title: JS Client: Uri inference in invocation · Issue #79 · polywrap/javascript-client · GitHub
Open Graph Title: JS Client: Uri inference in invocation · Issue #79 · polywrap/javascript-client
X Title: JS Client: Uri inference in invocation · Issue #79 · polywrap/javascript-client
Description: Our invoke function in the JS client looks like this: public async invoke
Open Graph Description: Our invoke function in the JS client looks like this: public async invoke
X Description: Our invoke function in the JS client looks like this: public async invoke<TData = unknown, TUri extends Uri | string = string>( options: InvokerOptions<TUri> ): Promise<InvokeResult&...
Opengraph URL: https://github.com/polywrap/javascript-client/issues/79
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JS Client: Uri inference in invocation","articleBody":"Our invoke function in the JS client looks like this:\r\n```ts\r\n public async invoke\u003cTData = unknown, TUri extends Uri | string = string\u003e(\r\n options: InvokerOptions\u003cTUri\u003e\r\n ): Promise\u003cInvokeResult\u003cTData\u003e\u003e {\r\n return super.invoke({\r\n ...options,\r\n uri: Uri.from(options.uri),\r\n });\r\n }\r\n```\r\nThere is a problem in how the generics are defined, in which if we pass a generic for the result type, the Uri must be a string (unless its defined). For example, if we do this:\r\n```ts\r\n const t = await client.invoke\u003cString\u003e({\r\n uri: new Uri(\"wrap/polywrap\"),\r\n method: \"h\"\r\n })\r\n}\r\n```\r\nIt will complain because the `uri` is of type `Uri`, instead of `String` we should support that the default is `Uri`","author":{"url":"https://github.com/krisbitney","@type":"Person","name":"krisbitney"},"datePublished":"2023-09-14T08:05:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/79/javascript-client/issues/79"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9a25849c-4429-7b16-97f1-9419945e451b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A788:2B00BF:2A23B8:359CF7:69742773 |
| html-safe-nonce | e364cbdc983c05ad6c6220b85ed02ca5b313270f749180017776a18be3800c5d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzg4OjJCMDBCRjoyQTIzQjg6MzU5Q0Y3OjY5NzQyNzczIiwidmlzaXRvcl9pZCI6IjMyOTI0NzgwODc4NTY2NjIzODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 431de6a800c06474dd2f8768a8929d7fe1fd1fbea93e490ccdfab8e1a655ff3a |
| hovercard-subject-tag | issue:1895984391 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/polywrap/javascript-client/79/issue_layout |
| twitter:image | https://opengraph.githubassets.com/33449b95ac6cca89f13ffaa4edc89fbf2548db09f5684e8a5710e3c124c9093e/polywrap/javascript-client/issues/79 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/33449b95ac6cca89f13ffaa4edc89fbf2548db09f5684e8a5710e3c124c9093e/polywrap/javascript-client/issues/79 |
| og:image:alt | Our invoke function in the JS client looks like this: public async invoke |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | krisbitney |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| turbo-cache-control | no-preview |
| go-import | github.com/polywrap/javascript-client git https://github.com/polywrap/javascript-client.git |
| octolytics-dimension-user_id | 66859008 |
| octolytics-dimension-user_login | polywrap |
| octolytics-dimension-repository_id | 617032996 |
| octolytics-dimension-repository_nwo | polywrap/javascript-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 617032996 |
| octolytics-dimension-repository_network_root_nwo | polywrap/javascript-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width