Skip to content

Commit

Permalink
Replace all usages of graphql-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Dec 2, 2020
1 parent 5d4ccdd commit 57ab05c
Show file tree
Hide file tree
Showing 36 changed files with 36 additions and 55 deletions.
3 changes: 1 addition & 2 deletions exchanges/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 1 addition & 2 deletions exchanges/execute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 1 addition & 2 deletions exchanges/graphcache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/ast/traversal.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { getSelectionSet } from './node';

import { getMainOperation, shouldInclude } from './traversal';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/ast/variables.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { getMainOperation } from './traversal';
import { normalizeVariables, filterVariables } from './variables';

Expand Down
3 changes: 1 addition & 2 deletions exchanges/graphcache/src/cacheExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import gql from 'graphql-tag';

import {
gql,
createClient,
ExchangeIO,
Operation,
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/extras/relayPagination.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write } from '../operations';
import { Store } from '../store';
import { relayPagination } from './relayPagination';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/extras/simplePagination.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write } from '../operations';
import { Store } from '../store';
import { simplePagination } from './simplePagination';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/offlineExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
gql,
createClient,
ExchangeIO,
Operation,
OperationResult,
formatDocument,
} from '@urql/core';

import gql from 'graphql-tag';
import { pipe, map, makeSubject, tap, publish } from 'wonka';
import { offlineExchange } from './offlineExchange';

Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/operations/query.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */

import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { minifyIntrospectionQuery } from '@urql/introspection';

import { Store } from '../store';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/operations/write.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */

import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { minifyIntrospectionQuery } from '@urql/introspection';

import { write } from './write';
Expand Down
3 changes: 1 addition & 2 deletions exchanges/graphcache/src/store/store.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */

import gql from 'graphql-tag';
import { minifyIntrospectionQuery } from '@urql/introspection';
import { maskTypename } from '@urql/core';
import { gql, maskTypename } from '@urql/core';
import { mocked } from 'ts-jest/utils';

import { Data, StorageAdapter } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/test-utils/examples-1.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write, writeOptimistic } from '../operations';
import * as InMemoryData from '../store/data';
import { Store } from '../store';
Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/test-utils/examples-2.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write } from '../operations';
import { Store } from '../store';

Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/test-utils/examples-3.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write } from '../operations';
import { Store } from '../store';

Expand Down
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/test-utils/suite.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DocumentNode } from 'graphql';
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { query, write } from '../operations';
import { Store } from '../store';

Expand Down
3 changes: 1 addition & 2 deletions exchanges/multipart-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion exchanges/multipart-fetch/src/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
gql,
GraphQLRequest,
OperationContext,
Operation,
makeOperation,
} from '@urql/core';
import gql from 'graphql-tag';

const context: OperationContext = {
fetchOptions: {
Expand Down
3 changes: 1 addition & 2 deletions exchanges/persisted-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion exchanges/persisted-fetch/src/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
gql,
GraphQLRequest,
OperationContext,
Operation,
makeOperation,
} from '@urql/core';
import gql from 'graphql-tag';

const context: OperationContext = {
fetchOptions: {
Expand Down
3 changes: 1 addition & 2 deletions exchanges/populate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 1 addition & 2 deletions exchanges/populate/src/populateExchange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
ASTKindToNode,
} from 'graphql';

import gql from 'graphql-tag';
import { fromValue, pipe, fromArray, toArray } from 'wonka';
import { Client, Operation, OperationContext, makeOperation } from '@urql/core';
import { gql, Client, Operation, OperationContext, makeOperation } from '@urql/core';

import { populateExchange } from './populateExchange';

Expand Down
4 changes: 2 additions & 2 deletions exchanges/refocus/src/refocusExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import gql from 'graphql-tag';

import { pipe, map, makeSubject, publish, tap } from 'wonka';

import {
gql,
createClient,
Operation,
OperationResult,
ExchangeIO,
} from '@urql/core';

import { refocusExchange } from './refocusExchange';

const dispatchDebug = jest.fn();
Expand Down
4 changes: 2 additions & 2 deletions exchanges/request-policy/src/requestPolicyExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import gql from 'graphql-tag';

import { pipe, map, makeSubject, publish, tap } from 'wonka';

import {
gql,
createClient,
Operation,
OperationResult,
ExchangeIO,
} from '@urql/core';

import { requestPolicyExchange } from './requestPolicyExchange';

const dispatchDebug = jest.fn();
Expand Down
4 changes: 2 additions & 2 deletions exchanges/retry/src/retryExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import gql from 'graphql-tag';

import { pipe, map, makeSubject, publish, tap } from 'wonka';

import {
gql,
createClient,
Operation,
OperationResult,
ExchangeIO,
} from '@urql/core';

import { retryExchange } from './retryExchange';

const dispatchDebug = jest.fn();
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"execa": "^4.1.0",
"glob": "^7.1.6",
"graphql": "^15.4.0",
"graphql-tag": "^2.11.0",
"husky": "^4.3.0",
"invariant": "^2.2.4",
"jest": "^26.6.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { print } from 'graphql';
import gql from 'graphql-tag';

/** NOTE: Testing in this file is designed to test both the client and its interaction with default Exchanges */

import { Source, map, pipe, subscribe, filter, toArray, tap } from 'wonka';
import { gql } from './gql';
import { Exchange, Operation, OperationResult } from './types';
import { createClient } from './client';
import { queryOperation } from './test-utils';
Expand Down
3 changes: 1 addition & 2 deletions packages/introspection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"preset": "../../scripts/jest/preset"
},
"devDependencies": {
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1"
"graphql": "^15.4.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/next-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"graphql": "^15.4.0",
"graphql-tag": "^2.10.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-is": "^17.0.1"
Expand Down
1 change: 0 additions & 1 deletion packages/preact-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"devDependencies": {
"@testing-library/preact": "^2.0.0",
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1",
"preact": "^10.5.5"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/preact-urql/src/hooks/useMutation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FunctionalComponent as FC, h } from 'preact';
import { render, cleanup, act } from '@testing-library/preact';
import { print } from 'graphql';
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { useMutation } from './useMutation';
import { fromValue, delay, pipe } from 'wonka';
import { Provider } from '../context';
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('useMutation', () => {
const call = client.executeMutation.mock.calls[0][0];
expect(state).toHaveProperty('fetching', true);
expect(client.executeMutation).toBeCalledTimes(1);
expect(print(call.query)).toBe(print(gql([props.query])));
expect(print(call.query)).toBe(print(gql(props.query)));
expect(call).toHaveProperty('variables', vars);
});

Expand Down
1 change: 0 additions & 1 deletion packages/react-urql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"@types/react": "^16.9.56",
"@types/react-test-renderer": "^16.9.3",
"graphql": "^15.4.0",
"graphql-tag": "^2.10.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-is": "^17.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-urql/src/hooks/useMutation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jest.mock('../context', () => {
});

import { print } from 'graphql';
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import React, { FC } from 'react';
import renderer, { act } from 'react-test-renderer';

Expand Down Expand Up @@ -89,7 +89,7 @@ describe('on execute', () => {
});

const call = client.executeMutation.mock.calls[0][0];
expect(print(call.query)).toBe(print(gql([props.query])));
expect(print(call.query)).toBe(print(gql(props.query)));
});

it('calls executeMutation with variables', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-urql/src/hooks/useRequest.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from '@urql/core';
import { renderHook } from '@testing-library/react-hooks';
import { useRequest } from './useRequest';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-urql/src/test-utils/ssr.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import gql from 'graphql-tag';
import prepass from 'react-ssr-prepass';
import { never, publish, filter, delay, pipe, map } from 'wonka';

import {
gql,
createClient,
Exchange,
dedupExchange,
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8123,11 +8123,6 @@ grapheme-splitter@^1.0.4:
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==

graphql-tag@^2.10.1, graphql-tag@^2.10.3, graphql-tag@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd"
integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA==

graphql@^15.1.0, graphql@^15.4.0:
version "15.4.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4.0.tgz#e459dea1150da5a106486ba7276518b5295a4347"
Expand Down

0 comments on commit 57ab05c

Please sign in to comment.