diff --git a/exchanges/graphcache/src/test-utils/examples-1.test.ts b/exchanges/graphcache/src/test-utils/examples-1.test.ts index 84c7058d5d..7609e54748 100644 --- a/exchanges/graphcache/src/test-utils/examples-1.test.ts +++ b/exchanges/graphcache/src/test-utils/examples-1.test.ts @@ -1,4 +1,4 @@ -import { formatDocument, gql } from '@urql/core'; +import { gql } from '@urql/core'; import { it, expect, afterEach } from 'vitest'; import { __initAnd_query as query } from '../operations/query'; import { @@ -9,7 +9,7 @@ import * as InMemoryData from '../store/data'; import { Store } from '../store/store'; import { Data } from '../types'; -const Todos = formatDocument(gql` +const Todos = gql` query { __typename todos { @@ -19,18 +19,18 @@ const Todos = formatDocument(gql` text } } -`); +`; -const TodoFragment = formatDocument(gql` +const TodoFragment = gql` fragment _ on Todo { __typename id text complete } -`); +`; -const Todo = formatDocument(gql` +const Todo = gql` query ($id: ID!) { __typename todo(id: $id) { @@ -39,9 +39,9 @@ const Todo = formatDocument(gql` complete } } -`); +`; -const ToggleTodo = formatDocument(gql` +const ToggleTodo = gql` mutation ($id: ID!) { __typename toggleTodo(id: $id) { @@ -51,9 +51,9 @@ const ToggleTodo = formatDocument(gql` complete } } -`); +`; -const NestedClearNameTodo = formatDocument(gql` +const NestedClearNameTodo = gql` mutation ($id: ID!) { __typename clearName(id: $id) { @@ -66,7 +66,7 @@ const NestedClearNameTodo = formatDocument(gql` } } } -`); +`; afterEach(() => { expect(console.warn).not.toHaveBeenCalled(); @@ -150,7 +150,7 @@ it('passes the "getting-started" example', () => { it('resolves missing, nullable arguments on fields', () => { const store = new Store(); - const GetWithVariables = formatDocument(gql` + const GetWithVariables = gql` query { __typename todo(first: null) { @@ -158,9 +158,9 @@ it('resolves missing, nullable arguments on fields', () => { id } } - `); + `; - const GetWithoutVariables = formatDocument(gql` + const GetWithoutVariables = gql` query { __typename todo { @@ -168,7 +168,7 @@ it('resolves missing, nullable arguments on fields', () => { id } } - `); + `; const dataToWrite = { __typename: 'Query', diff --git a/exchanges/graphcache/src/test-utils/examples-2.test.ts b/exchanges/graphcache/src/test-utils/examples-2.test.ts index bdbe975c66..dc2bfc6b7c 100644 --- a/exchanges/graphcache/src/test-utils/examples-2.test.ts +++ b/exchanges/graphcache/src/test-utils/examples-2.test.ts @@ -1,10 +1,10 @@ -import { formatDocument, gql } from '@urql/core'; +import { gql } from '@urql/core'; import { it, afterEach, expect } from 'vitest'; import { __initAnd_query as query } from '../operations/query'; import { __initAnd_write as write } from '../operations/write'; import { Store } from '../store/store'; -const Item = formatDocument(gql` +const Item = gql` { todo { __typename @@ -13,9 +13,9 @@ const Item = formatDocument(gql` text } } -`); +`; -const ItemDetailed = formatDocument(gql` +const ItemDetailed = gql` { todo { __typename @@ -29,9 +29,9 @@ const ItemDetailed = formatDocument(gql` } } } -`); +`; -const Pagination = formatDocument(gql` +const Pagination = gql` query { todos { __typename @@ -51,7 +51,7 @@ const Pagination = formatDocument(gql` } } } -`); +`; afterEach(() => { expect(console.warn).not.toHaveBeenCalled(); diff --git a/exchanges/graphcache/src/test-utils/examples-3.test.ts b/exchanges/graphcache/src/test-utils/examples-3.test.ts index 4dc91380e9..e88d9dee12 100644 --- a/exchanges/graphcache/src/test-utils/examples-3.test.ts +++ b/exchanges/graphcache/src/test-utils/examples-3.test.ts @@ -1,4 +1,4 @@ -import { formatDocument, gql } from '@urql/core'; +import { gql } from '@urql/core'; import { it, afterEach, expect } from 'vitest'; import { __initAnd_query as query } from '../operations/query'; import { __initAnd_write as write } from '../operations/write'; @@ -10,12 +10,12 @@ afterEach(() => { it('allows viewer fields to overwrite the root Query data', () => { const store = new Store(); - const get = formatDocument(gql` + const get = gql` { int } - `); - const set = formatDocument(gql` + `; + const set = gql` mutation { mutate { viewer { @@ -23,7 +23,7 @@ it('allows viewer fields to overwrite the root Query data', () => { } } } - `); + `; write( store, diff --git a/exchanges/graphcache/src/test-utils/suite.test.ts b/exchanges/graphcache/src/test-utils/suite.test.ts index 5994abcd0a..8c0f32cb2c 100644 --- a/exchanges/graphcache/src/test-utils/suite.test.ts +++ b/exchanges/graphcache/src/test-utils/suite.test.ts @@ -1,5 +1,5 @@ import { DocumentNode } from 'graphql'; -import { formatDocument, gql } from '@urql/core'; +import { gql } from '@urql/core'; import { it, expect } from 'vitest'; import { __initAnd_query as query } from '../operations/query'; import { __initAnd_write as write } from '../operations/write'; @@ -13,10 +13,7 @@ interface TestCase { const expectCacheIntegrity = (testcase: TestCase) => { const store = new Store(); - const request = { - query: formatDocument(testcase.query), - variables: testcase.variables, - }; + const request = { query: testcase.query, variables: testcase.variables }; const writeRes = write(store, request, testcase.data); const queryRes = query(store, request); expect(queryRes.data).not.toBe(null);