(ct: string | null | undefined)
| 53 | // --------------------------------------------------------------------------- |
| 54 | |
| 55 | const isJsonContentType = (ct: string | null | undefined): boolean => { |
| 56 | if (!ct) return false; |
| 57 | const normalized = ct.split(";")[0]?.trim().toLowerCase() ?? ""; |
| 58 | return ( |
| 59 | normalized === "application/json" || normalized.includes("+json") || normalized.includes("json") |
| 60 | ); |
| 61 | }; |
| 62 | |
| 63 | // --------------------------------------------------------------------------- |
| 64 | // Public API — execute a GraphQL operation |