@graphiql/react
Version:
[Changelog](https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/CHANGELOG.md) | [API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql_react.html) | [NPM](https://www.npmjs.com/package/@graphiql/react)
21 lines (16 loc) • 485 B
text/typescript
'use no memo';
import { GraphQLNamedType, GraphQLType } from 'graphql';
import { ExplorerContextType, ExplorerNavStackItem } from '../../context';
export function mockExplorerContextValue(
navStackItem: ExplorerNavStackItem,
): ExplorerContextType {
return {
explorerNavStack: [navStackItem],
pop() {},
push() {},
reset() {},
};
}
export function unwrapType(type: GraphQLType): GraphQLNamedType {
return 'ofType' in type ? unwrapType(type.ofType) : type;
}