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

Function decodePartial

packages/effect/src/internal/graphql.ts:248–257  ·  view source on GitHub ↗
(
    result: ExecutionResult
  )

Source from the content-addressed store, hash-verified

246 : decodeData(result.data)
247
248 const decodePartial = (
249 result: ExecutionResult
250 ): Effect.Effect<PartialResult<GraphQL.Result<Op>>, GraphQLClientError, Op["result"]["DecodingServices"]> => {
251 if (!isStatusOk(result) || result.data === null || result.data === undefined) return failResponse(result)
252 return Effect.map(decodeData(result.data), (data): PartialResult<GraphQL.Result<Op>> => {
253 const partial = { data, errors: result.errors ?? [] }
254 partialResponses.set(partial, result)
255 return partial
256 })
257 }
258
259 return { fail, schemaFail, encodeVariables, failResponse, decodeStrict, decodePartial } as const
260}

Callers 1

methodFunction · 0.85

Calls 5

isStatusOkFunction · 0.85
failResponseFunction · 0.85
decodeDataFunction · 0.85
setMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected