MCPcopy
hub / github.com/graphql/graphiql / parseHeaderString

Function parseHeaderString

packages/graphiql-react/src/schema.tsx:399–411  ·  view source on GitHub ↗
(headersString?: string)

Source from the content-addressed store, hash-verified

397}
398
399function parseHeaderString(headersString?: string) {
400 let headers: Record<string, unknown> | null = null;
401 let isValidJSON = true;
402
403 try {
404 if (headersString) {
405 headers = JSON.parse(headersString);
406 }
407 } catch {
408 isValidJSON = false;
409 }
410 return { headers, isValidJSON };
411}

Callers 1

fetchIntrospectionDataFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected