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

Function decodeData

packages/effect/src/internal/graphql.ts:214–217  ·  view source on GitHub ↗
(
    data: unknown
  )

Source from the content-addressed store, hash-verified

212 Effect.catch(encode(variables ?? {}), schemaFail((description) => new EncodeError({ description })))
213
214 const decodeData = (
215 data: unknown
216 ): Effect.Effect<GraphQL.Result<Op>, GraphQLClientError, Op["result"]["DecodingServices"]> =>
217 Effect.catch(decode(data), schemaFail((description) => new DecodeError({ description })))
218
219 // GraphQL requires errors when data is null or missing. Check before decoding,
220 // since schemas such as Schema.Json accept null. A non-2xx result never

Callers 2

decodeStrictFunction · 0.85
decodePartialFunction · 0.85

Calls 2

schemaFailFunction · 0.85
decodeFunction · 0.70

Tested by

no test coverage detected