Create TypeScript function to call compute endpoint
Created by: limitedmage
Write a TypeScript function to call the compute endpoint. The function should take the compute query and return any results.
- The function can live in stream.ts
- You can use
fetchEventSource
to call the API (example here) - The URL of the API is
/.api/compute/stream
- Try calling it with a few queries and logging the results to the console. Here's an example query:
repo:github\.com/sourcegraph/sourcegraph$ content:output((.|\n)* -> $author) type:commit after:"1 month ago" count:all