-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move query editor logic to @graphiql/react * avoid type assertion * avoid using class methods in e2e tests * fix test block description * mock codemirror hooks from @graphiql/react for tests * add changeset * fix build order * avoid recreating mocked codemirror textarea * avoid race conditons in async effects
- Loading branch information
1 parent
bc3dc64
commit d825bb7
Showing
26 changed files
with
595 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'graphiql': minor | ||
'@graphiql/react': minor | ||
--- | ||
|
||
Move the logic of the query editor from the `graphiql` package into a hook `useQueryEditor` provided by `@graphiql/react` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const base = require('../../jest.config.base')(__dirname); | ||
|
||
module.exports = { | ||
...base, | ||
}; |
8 changes: 8 additions & 0 deletions
8
packages/graphiql-react/src/editor/__tests__/whitespace.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { invalidCharacters, normalizeWhitespace } from '../whitespace'; | ||
|
||
describe('normalizeWhitespace', () => { | ||
it('removes unicode characters', () => { | ||
const result = normalizeWhitespace(invalidCharacters.join('')); | ||
expect(result).toEqual(' '.repeat(invalidCharacters.length)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import { EditorContext, EditorContextProvider } from './context'; | ||
import { useHeaderEditor } from './header-editor'; | ||
import { useQueryEditor } from './query-editor'; | ||
|
||
import type { EditorContextType } from './context'; | ||
import type { UseHeaderEditorArgs } from './header-editor'; | ||
import type { UseQueryEditorArgs } from './query-editor'; | ||
|
||
export { EditorContext, EditorContextProvider, useHeaderEditor }; | ||
export { | ||
EditorContext, | ||
EditorContextProvider, | ||
useHeaderEditor, | ||
useQueryEditor, | ||
}; | ||
|
||
export type { EditorContextType, UseHeaderEditorArgs }; | ||
export type { EditorContextType, UseHeaderEditorArgs, UseQueryEditorArgs }; |
Oops, something went wrong.