Skip to content

Commit 8ebedc9

Browse files
authored
export createLocalStorage in UMD bundle (#3359)
resolves #3358
1 parent 9cc88df commit 8ebedc9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/nice-cheetahs-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"graphiql": patch
3+
---
4+
5+
export createLocalStorage in UMD bundle

packages/graphiql/src/cdn.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77
import * as GraphiQLReact from '@graphiql/react';
8-
import { createGraphiQLFetcher } from '@graphiql/toolkit';
8+
import { createGraphiQLFetcher, createLocalStorage } from '@graphiql/toolkit';
99
import * as GraphQL from 'graphql';
1010
import { GraphiQL } from './components/GraphiQL';
1111

@@ -25,6 +25,12 @@ import './style.css';
2525
// @ts-expect-error
2626
GraphiQL.createFetcher = createGraphiQLFetcher;
2727

28+
/**
29+
* This function is needed in order to easily generate a custom storage namespace
30+
*/
31+
// @ts-expect-error
32+
GraphiQL.createLocalStorage = createLocalStorage;
33+
2834
/**
2935
* We also add the complete `graphiql-js` exports so that this instance of
3036
* `graphiql-js` can be reused from plugin CDN bundles.

0 commit comments

Comments
 (0)