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

Function serializeTabState

packages/graphiql-react/src/editor/tabs.ts:224–235  ·  view source on GitHub ↗
(
  tabState: TabsState,
  shouldPersistHeaders = false,
)

Source from the content-addressed store, hash-verified

222}
223
224export function serializeTabState(
225 tabState: TabsState,
226 shouldPersistHeaders = false,
227) {
228 return JSON.stringify(tabState, (key, value) =>
229 key === 'hash' ||
230 key === 'response' ||
231 (!shouldPersistHeaders && key === 'headers')
232 ? null
233 : value,
234 );
235}
236
237export function useStoreTabs({
238 storage,

Callers 2

setShouldPersistHeadersFunction · 0.90
useStoreTabsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected