({
query = null,
variables = null,
headers = null,
}: Partial<TabDefinition> = {})
| 291 | } |
| 292 | |
| 293 | export function createTab({ |
| 294 | query = null, |
| 295 | variables = null, |
| 296 | headers = null, |
| 297 | }: Partial<TabDefinition> = {}): TabState { |
| 298 | const operationName = query ? fuzzyExtractOperationName(query) : null; |
| 299 | return { |
| 300 | id: guid(), |
| 301 | hash: hashFromTabContents({ query, variables, headers }), |
| 302 | title: operationName || DEFAULT_TITLE, |
| 303 | query, |
| 304 | variables, |
| 305 | headers, |
| 306 | operationName, |
| 307 | response: null, |
| 308 | }; |
| 309 | } |
| 310 | |
| 311 | export function setPropertiesInActiveTab( |
| 312 | state: TabsState, |
no test coverage detected