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

Function method

packages/effect/src/graphql/GraphQLClient.ts:449–468  ·  view source on GitHub ↗
(
    variables?: GraphQL.Variables<Op>,
    options?: CallOptions<R2>
  )

Source from the content-addressed store, hash-verified

447 ...args: Args<GraphQL.Variables<Op>, CallOptions<R2> & { readonly partial?: false | undefined }>
448 ): Effect.Effect<GraphQL.Result<Op>, GraphQL.Error<Op>, Exclude<GraphQL.Services<Op>, R2>>
449 function method<R2>(
450 variables?: GraphQL.Variables<Op>,
451 options?: CallOptions<R2>
452 ): Effect.Effect<
453 GraphQL.Result<Op> | PartialResult<GraphQL.Result<Op>>,
454 GraphQL.Error<Op>,
455 Exclude<GraphQL.Services<Op>, R2>
456 > {
457 return buildRequest(variables, options).pipe(
458 Effect.flatMap((request) => run(request, false)),
459 Effect.flatMap(
460 (result): Effect.Effect<
461 GraphQL.Result<Op> | PartialResult<GraphQL.Result<Op>>,
462 GraphQLClientError,
463 Op["result"]["DecodingServices"]
464 > => options?.partial === true ? decodePartial(result) : decodeStrict(result)
465 ),
466 Effect.provideContext(callContext(options))
467 )
468 }
469 internalGraphQL.rawExecutors.set(method, { execute: (request) => run(request, true), url: protocol.url })
470 return Object.assign(method, { operation })
471}

Callers

nothing calls this directly

Calls 6

buildRequestFunction · 0.85
decodePartialFunction · 0.85
decodeStrictFunction · 0.85
callContextFunction · 0.85
runFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected