Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to external graphql-tag package #313

Merged
merged 3 commits into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Expect active development and potentially significant breaking changes in the `0

### vNEXT

- Move out GraphQL query parsing into a new package [`graphql-tag`](https://github.com/apollostack/graphql-tag) with a backcompat shim for `apollo-client/gql`. [Issue #312](https://github.com/apollostack/apollo-client/issues/312) [PR #313](https://github.com/apollostack/apollo-client/pull/313)

### v0.3.20

- Exported `writeQueryToStore` and `writeFragmentToStore` directly from `apollo-client` to match `readQueryFromStore` and `readFragmentFromStore`. [PR #311](https://github.com/apollostack/apollo-client/pull/311)
Expand Down
6 changes: 2 additions & 4 deletions gql.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/* We are placing this file in the root to enable npm-link development
* Currently, gql resides in a submodule and is not able to be imported when linked
*/
module.exports = require('./lib/src/gql');
// This is here for backcompat, even though the right way is to use the other package
module.exports = require('graphql-tag');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dependencies": {
"es6-promise": "^3.1.2",
"graphql": "^0.4.18 || ^0.5.0 || ^0.6.0",
"graphql-tag": "^0.1.1",
"lodash.assign": "^4.0.8",
"lodash.clonedeep": "^4.3.2",
"lodash.countby": "^4.4.0",
Expand All @@ -47,12 +48,12 @@
"lodash.includes": "^4.1.2",
"lodash.isarray": "^4.0.0",
"lodash.isboolean": "^3.0.3",
"lodash.isequal": "^4.2.0",
"lodash.isnull": "^3.0.0",
"lodash.isnumber": "^3.0.3",
"lodash.isobject": "^3.0.2",
"lodash.isstring": "^4.0.1",
"lodash.isundefined": "^3.0.1",
"lodash.isequal": "^4.2.0",
"redux": "^3.3.1",
"symbol-observable": "^0.2.4",
"whatwg-fetch": "^1.0.0"
Expand Down
47 changes: 0 additions & 47 deletions src/gql.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
addTypenameToSelectionSet,
} from '../src/queries/queryTransform';

import gql from '../src/gql';
import gql from 'graphql-tag';

import {
assert,
Expand Down
2 changes: 1 addition & 1 deletion test/batching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { assert } from 'chai';
import mockNetworkInterface, {
mockBatchedNetworkInterface,
} from './mocks/mockNetworkInterface';
import gql from '../src/gql';
import gql from 'graphql-tag';
import { GraphQLResult } from 'graphql';

const networkInterface = mockNetworkInterface();
Expand Down
2 changes: 1 addition & 1 deletion test/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Store,
} from '../src/store';

import gql from '../src/gql';
import gql from 'graphql-tag';

import {
createStore,
Expand Down
2 changes: 1 addition & 1 deletion test/diffAgainstStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
NormalizedCache,
} from '../src/data/store';

import gql from '../src/gql';
import gql from 'graphql-tag';

describe('diffing queries against the store', () => {
it('returns nothing when the store is enough', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
getQueryDefinition,
} from '../src/queries/getFromAST';

import gql from '../src/gql';
import gql from 'graphql-tag';

import cloneDeep = require('lodash.clonedeep');

Expand Down
2 changes: 1 addition & 1 deletion test/getFromAST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
OperationDefinition,
} from 'graphql';
import { print } from 'graphql/language/printer';
import gql from '../src/gql';
import gql from 'graphql-tag';
import { assert } from 'chai';

describe('AST utility functions', () => {
Expand Down
13 changes: 0 additions & 13 deletions test/gql.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/networkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
MiddlewareRequest,
} from '../src/middleware';

import gql from '../src/gql';
import gql from 'graphql-tag';

import { print } from 'graphql/language/printer';

Expand Down
2 changes: 1 addition & 1 deletion test/queryMerging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
OperationDefinition,
} from 'graphql';

import gql from '../src/gql';
import gql from 'graphql-tag';
import { assert } from 'chai';
import cloneDeep = require('lodash.clonedeep');

Expand Down
2 changes: 1 addition & 1 deletion test/queryTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getMutationDefinition,
} from '../src/queries/getFromAST';
import { print } from 'graphql/language/printer';
import gql from '../src/gql';
import gql from 'graphql-tag';
import { assert } from 'chai';

describe('query transforms', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/readFromStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
StoreObject,
} from '../src/data/store';

import gql from '../src/gql';
import gql from 'graphql-tag';

describe('reading from the store', () => {
it('rejects malformed queries', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/roundtrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Document,
} from 'graphql';

import gql from '../src/gql';
import gql from 'graphql-tag';

describe('roundtrip', () => {
it('real graphql result', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createApolloStore,
} from '../src/store';
import mockNetworkInterface from './mocks/mockNetworkInterface';
import gql from '../src/gql';
import gql from 'graphql-tag';

describe('QueryScheduler', () => {
it('should throw an error if we try to register a non-polling query', () => {
Expand Down
1 change: 0 additions & 1 deletion test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import './networkInterface';
import './QueryManager';
import './client';
import './store';
import './gql';
import './queryTransform';
import './getFromAST';
import './directives';
Expand Down
2 changes: 1 addition & 1 deletion test/writeToStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
Node,
} from 'graphql';

import gql from '../src/gql';
import gql from 'graphql-tag';

describe('writing to the store', () => {
it('properly normalizes a trivial item', () => {
Expand Down