Skip to content

Commit 428467c

Browse files
committed
Lets go
1 parent ebd952e commit 428467c

File tree

4 files changed

+10
-29
lines changed

4 files changed

+10
-29
lines changed

examples/nextjs-app/__integration-tests__/nextjs-app.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('nextjs 13 App Router', () => {
2525
});
2626

2727
expect(response.ok).toBe(true);
28-
expect(await response.text()).toContain('<title>Yoga GraphiQL</title>');
28+
expect(await response.text()).toContain('Yoga GraphiQL');
2929
});
3030

3131
it('should run basic query', async () => {

packages/graphiql/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"json-bigint-patch": "0.0.8",
4242
"react": "19.1.0",
4343
"react-dom": "19.1.0",
44-
"tslib": "2.8.1",
45-
"use-url-search-params": "2.5.1"
44+
"tslib": "2.8.1"
4645
},
4746
"devDependencies": {
4847
"@types/react": "19.1.8",

packages/graphiql/src/YogaGraphiQL.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Fetcher, FetcherOpts, FetcherParams } from '@graphiql/toolkit';
77
import { LoadFromUrlOptions, SubscriptionProtocol, UrlLoader } from '@graphql-tools/url-loader';
88
import 'json-bigint-patch';
99
import React, { useMemo } from 'react';
10-
import { useUrlSearchParams } from 'use-url-search-params';
1110
import { YogaLogo } from './YogaLogo';
1211
import './styles.css';
1312

@@ -81,10 +80,6 @@ export function YogaGraphiQL(props: YogaGraphiQLProps): React.ReactElement {
8180

8281
const endpoint = new URL(props.endpoint ?? location.pathname, location.href).toString();
8382

84-
const type = {
85-
query: String,
86-
};
87-
8883
const urlLoader = useMemo(() => new UrlLoader(), []);
8984

9085
const fetcher = useMemo(() => {
@@ -126,14 +121,6 @@ export function YogaGraphiQL(props: YogaGraphiQLProps): React.ReactElement {
126121
};
127122
}, [urlLoader, endpoint, props.fetcher]) as Fetcher;
128123

129-
const [params, setParams] = useUrlSearchParams(
130-
{
131-
query: props.defaultQuery || initialQuery,
132-
},
133-
type,
134-
false,
135-
);
136-
137124
const explorer = explorerPlugin({
138125
showAttribution: true,
139126
});
@@ -148,13 +135,7 @@ export function YogaGraphiQL(props: YogaGraphiQLProps): React.ReactElement {
148135
inputValueDeprecation={true}
149136
isHeadersEditorEnabled
150137
defaultEditorToolsVisibility
151-
initialQuery={params['query']?.toString()}
152-
onEditQuery={(query, ast) => {
153-
setParams({
154-
query,
155-
});
156-
props.onEditQuery?.(query, ast);
157-
}}
138+
initialQuery={initialQuery}
158139
{...props}
159140
fetcher={fetcher}
160141
>

packages/graphql-yoga/__integration-tests__/browser.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ describe('browser', () => {
277277
},
278278
log(name, severity, message, args, hints) {
279279
if (severity === 'error') {
280+
// eslint-disable-next-line no-console
280281
console.error(wrapColor(`[${name}] ${message}`, hints.color), ...args);
281282
} else {
283+
// eslint-disable-next-line no-console
282284
console.log(wrapColor(`[${name}] ${message}`), ...args);
283285
}
284286
},
@@ -307,28 +309,27 @@ describe('browser', () => {
307309
});
308310

309311
const typeOperationText = async (text: string) => {
310-
await page.type('.graphiql-query-editor .CodeMirror textarea', text, { delay: 300 });
312+
await page.type('.graphiql-editor textarea', text, { delay: 300 });
311313
// TODO: figure out how we can avoid this wait
312314
// it is very likely that there is a delay from textarea -> react state update
313315
await setTimeout$(300);
314316
};
315317

316318
const typeVariablesText = async (text: string) => {
317-
await page.type('[aria-label="Variables"] .CodeMirror textarea', text, { delay: 100 });
319+
await page.type('[data-uri="file:///ro-variables.json"] textarea', text, { delay: 100 });
318320
// TODO: figure out how we can avoid this wait
319321
// it is very likely that there is a delay from textarea -> react state update
320322
await setTimeout$(100);
321323
};
322324

323325
const waitForResult = async (): Promise<object> => {
324-
await page.waitForSelector('.graphiql-response .CodeMirror-code');
326+
await page.waitForSelector('.result-window textarea');
325327
await page.waitForFunction(
326-
() =>
327-
!!window.document.querySelector('.graphiql-response .CodeMirror-code')?.textContent?.trim(),
328+
() => !!window.document.querySelector('.result-window textarea')?.textContent?.trim(),
328329
);
329330
const resultContents = await page.evaluate(() => {
330331
return window.document
331-
.querySelector('.graphiql-response .CodeMirror-code')
332+
.querySelector('.result-window textarea')
332333
?.textContent?.trim()
333334
.replaceAll('\u00A0', ' ');
334335
});

0 commit comments

Comments
 (0)