This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema | |
@link(url: "https://specs.apollo.dev/link/v1.0") | |
@link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) { | |
query: Query | |
} | |
directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE | |
directive @join__field( | |
graph: join__Graph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema | |
@link(url: "https://specs.apollo.dev/link/v1.0") | |
@link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) | |
@link(url: "https://specs.apollo.dev/tag/v0.3") | |
{ | |
query: Query | |
mutation: Mutation | |
subscription: Subscription | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema | |
@core(feature: "https://specs.apollo.dev/core/v0.2") | |
@core(feature: "https://specs.apollo.dev/join/v0.1", for: EXECUTION) { | |
query: Query | |
} | |
directive @core(as: String, feature: String!, for: core__Purpose) repeatable on SCHEMA | |
directive @join__field( | |
graph: join__Graph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JSONSchema } from './types'; | |
type RequiredPropertyKeys<TProperties extends Record<string, JSONSchema>> = { | |
[K in keyof TProperties]: TProperties[K] extends { ['__optional']: true } ? never : K; | |
}[keyof TProperties]; | |
const sharedHelpers = { | |
$format<TThis extends JSONSchema, TFormat extends string>( | |
this: TThis, | |
format: TFormat, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { TypedResponseCtor } from "../typed-fetch-api"; | |
import { TypedRouter } from "../typed-router"; | |
const TypedResponseCtorObj = {} as TypedResponseCtor; | |
const typedRouter = {} as TypedRouter; | |
typedRouter.get<{ | |
Request: { | |
QueryParams: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { request as httpRequest } from 'http'; | |
import { request as httpsRequest } from 'https'; | |
import { MeshPlugin } from '@graphql-mesh/types'; | |
import { Readable } from 'stream'; | |
function getRequestFnForProtocol(protocol: string) { | |
switch (protocol) { | |
case 'http:': | |
return httpRequest; | |
case 'https:': |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "CloudflareAPI", | |
"baseUrl": "https://api.cloudflare.com/client/v4", | |
"operations": [ | |
{ | |
"method": "GET", | |
"path": "/accounts", | |
"type": "query", | |
"field": "accounts_list_accounts", | |
"description": "List all accounts you have ownership or verified access to.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getLRUCache<V>(max = 1000) { | |
let storage: Record<string, V> = {} | |
let keys: string[] = [] | |
return { | |
get(key: string) { | |
return storage[key] | |
}, | |
set(key: string, value: V) { | |
queueMicrotask(() => { | |
if (storage[key] != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAsyncIterableFromEventTarget(eventTarget: EventTarget, eventName: string): AsyncGenerator<Event> { | |
const pushQueue: Array<IteratorResult<Event>> = [] | |
const pullQueue: Array<(iteratorResult: IteratorResult<Event>) => void> = [] | |
let listening = true; | |
function pushValue(event: Event) { | |
if (pullQueue.length !== 0) { | |
// It is safe to use the ! operator here as we check the length. | |
pullQueue.shift()!({ value: event, done: false }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema { | |
query: Query | |
mutation: Mutation | |
} | |
type TGraphEntity implements GraphEntity { | |
id: String! | |
} | |
interface GraphEntity { |
NewerOlder