Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Dec 16, 2024
1 parent fcb7a13 commit 3b7afd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/long-parents-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphiql/react': patch
'@graphiql/plugin-explorer': patch
---

fix query builder updated only first selected field in query editor due recent enabled react-compiler
3 changes: 2 additions & 1 deletion packages/graphiql-react/src/editor/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { EditorChange, EditorConfiguration } from 'codemirror';
import type { SchemaReference } from 'codemirror-graphql/utils/SchemaReference';
import copyToClipboard from 'copy-to-clipboard';
import { parse, print } from 'graphql';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- TODO: check why query builder update only 1st field https://github.com/graphql/graphiql/issues/3836
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';

import { useExplorerContext } from '../explorer';
Expand Down Expand Up @@ -345,7 +346,7 @@ export function useAutoCompleteLeafs({
// https://react.dev/learn/you-might-not-need-an-effect

export const useEditorState = (editor: 'query' | 'variable' | 'header') => {
'use no memo' // TODO: check why query builder update only 1st field https://github.com/graphql/graphiql/issues/3836
'use no memo'; // eslint-disable-line react-compiler/react-compiler -- TODO: check why query builder update only 1st field https://github.com/graphql/graphiql/issues/3836
const context = useEditorContext({
nonNull: true,
});
Expand Down

0 comments on commit 3b7afd3

Please sign in to comment.