Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(github): all GitHub GraphQL on effect/graphql, one request policy for REST and GraphQL #19224

Mergedjuliusmarmingemerged 8 commits intomain fromrefs/pull/19224/headmerged by juliusmarminge View on GitHub

Showing 55 changed files with 57 additions and 62 deletions (loading 51).

x
0 of 55 viewed, 55 left
3 additions and 0 deletions.github/workflows/ci.ymlModified
View file
@@ -52,6 +52,9 @@
- name: Check unused code
run: vp run knip:check
​
+ - name: Check generated GitHub GraphQL operations
+ run: vp run --filter @t3tools/source-control-github generate --check
+​
- name: Check
run: vp check
​
51 additions and 54 deletionsapps/server/scripts/measure-pr-preview.tsModified
View file
@@ -1,23 +1,21 @@
// Run with: node apps/server/scripts/measure-pr-preview.ts owner/repo 123 456
// Numbers form a session with shared repository-permission caches. Browser and
// service caches are excluded. Uses real GitHub reads, without a server or database.
-// Each GraphQL read asks for `rateLimit` here, so its cost is read off its own answer.
+// Requests are counted at the HTTP client. A GraphQL request's cost is how far it moved GitHub's
+// `x-ratelimit-used` for the `graphql` resource, which is approximate when anything else spends
+// the same token's quota while this runs.
import * as NodeServices from "@effect/platform-node/NodeServices";
import * as Effect from "effect/Effect";
import * as Console from "effect/Console";
import * as Layer from "effect/Layer";
-import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
-import { FetchHttpClient } from "effect/http";
+import { FetchHttpClient, HttpClient } from "effect/http";
​