MCPcopy Create free account
hub / github.com/Effect-TS/effect / urlResolver

Function urlResolver

packages/effect/src/graphql/GraphQLProtocol.ts:406–411  ·  view source on GitHub ↗
(url: Url)

Source from the content-addressed store, hash-verified

404}
405
406const urlResolver = (url: Url): NonNullable<GraphQLProtocol["Service"]["url"]> => {
407 if (typeof url === "string") return constant(Effect.succeed(url))
408 if (Effect.isEffect(url)) return constant(url)
409 return ({ kind, operationName }) =>
410 Effect.contextWith((context: Context.Context<never>) => Effect.succeed(url({ context, kind, operationName })))
411}
412
413/**
414 * Builds the HTTP transport as an effect, for composing transports by hand.

Callers 1

makeHttpWithFunction · 0.85

Calls 3

constantFunction · 0.90
urlFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected