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

Typescript type safety #141

Merged
merged 2 commits into from
Feb 6, 2018
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
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export default function gql(literals: any, ...placeholders: any[]): any;
import { DocumentNode } from 'graphql';

export default function gql(template: TemplateStringsArray, ...substitutions: any[]): DocumentNode;
export function resetCaches(): void;
export function disableFragmentWarnings(): void;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"url": "https://github.com/apollostack/graphql-tag/issues"
},
"homepage": "https://github.com/apollostack/graphql-tag#readme",
"dependencies": {},
"dependencies": {
"@types/graphql": ">=0.8.6 <=0.11.7"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.12.x should also export DocumentNode, how about >=0.8.6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the time I opened this PR 0.12 didn't exist, will update.
I don't understand the second question? 0.8.6 was the first version to export it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that by just specifying the dependency as "@types/graphql": ">=0.8.6", and omitting the <=x.x.x the right hand side won't continue to need to be bumped each time a release is cut.

Copy link
Contributor Author

@felixfbecker felixfbecker Jan 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know the next version does not contain a breaking change? It doesn't have to be bumped every time a release is cut, it's an interface so it will work fine if you use a different version in your project that is compatible

},
"devDependencies": {
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
Expand Down
24 changes: 14 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# yarn lockfile v1


"@types/graphql@>=0.8.6 <=0.11.7":
version "0.11.7"
resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-0.11.7.tgz#da39a2f7c74e793e32e2bb7b3b68da1691532dd5"

ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
Expand Down Expand Up @@ -527,11 +531,11 @@ globals@^9.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"

graphql@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.0.tgz#29e4f83d85e79245f8496f40a2232e6e5c5baaee"
graphql@^0.11.0:
version "0.11.7"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.11.7.tgz#e5abaa9cb7b7cccb84e9f0836bf4370d268750c6"
dependencies:
iterall "^1.1.0"
iterall "1.1.3"

[email protected]:
version "1.9.2"
Expand Down Expand Up @@ -577,9 +581,9 @@ is-finite@^1.0.0:
dependencies:
number-is-nan "^1.0.0"

iterall@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.1.tgz#f7f0af11e9a04ec6426260f5019d9fcca4d50214"
[email protected].3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.3.tgz#1cbbff96204056dde6656e2ed2e2226d0e6d72c9"

js-tokens@^3.0.0:
version "3.0.1"
Expand Down Expand Up @@ -764,9 +768,9 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"

rollup@^0.42.0:
version "0.42.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.42.0.tgz#56e791b3a2f3dd7190bbb80a375675f2fe0f9b23"
rollup@^0.45.0:
version "0.45.2"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.45.2.tgz#63a284c2b31234656f24e9e9717fabb6a7f0fa43"
dependencies:
source-map-support "^0.4.0"

Expand Down