Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

graphql-tag

Package Overview
Dependencies
Maintainers
6
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-tag - npm Package Compare versions

Comparing version
2.0.0
to
2.1.0
+806
yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
assertion-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
babel-code-frame@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
dependencies:
chalk "^1.1.0"
esutils "^2.0.2"
js-tokens "^3.0.0"
babel-core@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02"
dependencies:
babel-code-frame "^6.22.0"
babel-generator "^6.24.0"
babel-helpers "^6.23.0"
babel-messages "^6.23.0"
babel-register "^6.24.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.1"
babel-types "^6.23.0"
babylon "^6.11.0"
convert-source-map "^1.1.0"
debug "^2.1.1"
json5 "^0.5.0"
lodash "^4.2.0"
minimatch "^3.0.2"
path-is-absolute "^1.0.0"
private "^0.1.6"
slash "^1.0.0"
source-map "^0.5.0"
babel-generator@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56"
dependencies:
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.23.0"
detect-indent "^4.0.0"
jsesc "^1.3.0"
lodash "^4.2.0"
source-map "^0.5.0"
trim-right "^1.0.1"
babel-helper-call-delegate@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef"
dependencies:
babel-helper-hoist-variables "^6.22.0"
babel-runtime "^6.22.0"
babel-traverse "^6.22.0"
babel-types "^6.22.0"
babel-helper-define-map@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7"
dependencies:
babel-helper-function-name "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.23.0"
lodash "^4.2.0"
babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6"
dependencies:
babel-helper-get-function-arity "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babel-helper-get-function-arity@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-helper-hoist-variables@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-helper-optimise-call-expression@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.23.0"
babel-helper-regex@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
lodash "^4.2.0"
babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd"
dependencies:
babel-helper-optimise-call-expression "^6.23.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babel-helpers@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-messages@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-check-es2015-constants@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-arrow-functions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-block-scoping@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
lodash "^4.2.0"
babel-plugin-transform-es2015-classes@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1"
dependencies:
babel-helper-define-map "^6.23.0"
babel-helper-function-name "^6.23.0"
babel-helper-optimise-call-expression "^6.23.0"
babel-helper-replace-supers "^6.23.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babel-plugin-transform-es2015-computed-properties@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7"
dependencies:
babel-runtime "^6.22.0"
babel-template "^6.22.0"
babel-plugin-transform-es2015-destructuring@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-duplicate-keys@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-plugin-transform-es2015-for-of@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-function-name@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104"
dependencies:
babel-helper-function-name "^6.22.0"
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-plugin-transform-es2015-literals@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-modules-amd@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e"
dependencies:
babel-plugin-transform-es2015-modules-commonjs "^6.24.0"
babel-runtime "^6.22.0"
babel-template "^6.22.0"
babel-plugin-transform-es2015-modules-commonjs@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f"
dependencies:
babel-plugin-transform-strict-mode "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-types "^6.23.0"
babel-plugin-transform-es2015-modules-systemjs@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0"
dependencies:
babel-helper-hoist-variables "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-plugin-transform-es2015-modules-umd@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450"
dependencies:
babel-plugin-transform-es2015-modules-amd "^6.24.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-plugin-transform-es2015-object-super@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc"
dependencies:
babel-helper-replace-supers "^6.22.0"
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-parameters@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b"
dependencies:
babel-helper-call-delegate "^6.22.0"
babel-helper-get-function-arity "^6.22.0"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babel-plugin-transform-es2015-shorthand-properties@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-plugin-transform-es2015-spread@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-sticky-regex@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593"
dependencies:
babel-helper-regex "^6.22.0"
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-plugin-transform-es2015-template-literals@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-unicode-regex@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20"
dependencies:
babel-helper-regex "^6.22.0"
babel-runtime "^6.22.0"
regexpu-core "^2.0.0"
babel-plugin-transform-regenerator@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6"
dependencies:
regenerator-transform "0.9.8"
babel-plugin-transform-strict-mode@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c"
dependencies:
babel-runtime "^6.22.0"
babel-types "^6.22.0"
babel-preset-es2015@^6.9.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a"
dependencies:
babel-plugin-check-es2015-constants "^6.22.0"
babel-plugin-transform-es2015-arrow-functions "^6.22.0"
babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
babel-plugin-transform-es2015-block-scoping "^6.22.0"
babel-plugin-transform-es2015-classes "^6.22.0"
babel-plugin-transform-es2015-computed-properties "^6.22.0"
babel-plugin-transform-es2015-destructuring "^6.22.0"
babel-plugin-transform-es2015-duplicate-keys "^6.22.0"
babel-plugin-transform-es2015-for-of "^6.22.0"
babel-plugin-transform-es2015-function-name "^6.22.0"
babel-plugin-transform-es2015-literals "^6.22.0"
babel-plugin-transform-es2015-modules-amd "^6.24.0"
babel-plugin-transform-es2015-modules-commonjs "^6.24.0"
babel-plugin-transform-es2015-modules-systemjs "^6.22.0"
babel-plugin-transform-es2015-modules-umd "^6.24.0"
babel-plugin-transform-es2015-object-super "^6.22.0"
babel-plugin-transform-es2015-parameters "^6.22.0"
babel-plugin-transform-es2015-shorthand-properties "^6.22.0"
babel-plugin-transform-es2015-spread "^6.22.0"
babel-plugin-transform-es2015-sticky-regex "^6.22.0"
babel-plugin-transform-es2015-template-literals "^6.22.0"
babel-plugin-transform-es2015-typeof-symbol "^6.22.0"
babel-plugin-transform-es2015-unicode-regex "^6.22.0"
babel-plugin-transform-regenerator "^6.22.0"
babel-register@^6.24.0, babel-register@^6.9.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.0.tgz#5e89f8463ba9970356d02eb07dabe3308b080cfd"
dependencies:
babel-core "^6.24.0"
babel-runtime "^6.22.0"
core-js "^2.4.0"
home-or-tmp "^2.0.0"
lodash "^4.2.0"
mkdirp "^0.5.1"
source-map-support "^0.4.2"
babel-runtime@^6.18.0, babel-runtime@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"
babel-template@^6.22.0, babel-template@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babylon "^6.11.0"
lodash "^4.2.0"
babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1:
version "6.23.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48"
dependencies:
babel-code-frame "^6.22.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.23.0"
babylon "^6.15.0"
debug "^2.2.0"
globals "^9.0.0"
invariant "^2.2.0"
lodash "^4.2.0"
babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf"
dependencies:
babel-runtime "^6.22.0"
esutils "^2.0.2"
lodash "^4.2.0"
to-fast-properties "^1.0.1"
babylon@^6.11.0, babylon@^6.15.0:
version "6.16.1"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
balanced-match@^0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
brace-expansion@^1.0.0:
version "1.1.7"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59"
dependencies:
balanced-match "^0.4.1"
concat-map "0.0.1"
browser-stdout@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f"
chai@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247"
dependencies:
assertion-error "^1.0.1"
deep-eql "^0.1.3"
type-detect "^1.0.0"
chalk@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
commander@2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
dependencies:
graceful-readlink ">= 1.0.0"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
convert-source-map@^1.1.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5"
core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
debug@2.2.0, debug@^2.1.1, debug@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
dependencies:
ms "0.7.1"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies:
type-detect "0.1.1"
detect-indent@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
dependencies:
repeating "^2.0.0"
diff@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf"
escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
glob@7.0.5:
version "7.0.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.2"
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^9.0.0:
version "9.17.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286"
"graceful-readlink@>= 1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
graphql@^0.9.1:
version "0.9.2"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.9.2.tgz#2cb5c635de13f790a77c5879649cb401b1589386"
dependencies:
iterall "1.0.3"
growl@1.9.2:
version "1.9.2"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.1"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
invariant@^2.2.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
dependencies:
loose-envify "^1.0.0"
is-finite@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
dependencies:
number-is-nan "^1.0.0"
iterall@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.0.3.tgz#e0b31958f835013c323ff0b10943829ac69aa4b7"
js-tokens@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
jsesc@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
jsesc@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
json3@3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
json5@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
lodash._baseassign@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
dependencies:
lodash._basecopy "^3.0.0"
lodash.keys "^3.0.0"
lodash._basecopy@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
lodash._basecreate@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821"
lodash._getnative@^3.0.0:
version "3.9.1"
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
lodash._isiterateecall@^3.0.0:
version "3.0.9"
resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c"
lodash.create@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7"
dependencies:
lodash._baseassign "^3.0.0"
lodash._basecreate "^3.0.0"
lodash._isiterateecall "^3.0.0"
lodash.isarguments@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
lodash.isarray@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
lodash.keys@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
dependencies:
lodash._getnative "^3.0.0"
lodash.isarguments "^3.0.0"
lodash.isarray "^3.0.0"
lodash@^4.2.0:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
loose-envify@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"
minimatch@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
dependencies:
brace-expansion "^1.0.0"
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
mkdirp@0.5.1, mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
minimist "0.0.8"
mocha@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3"
dependencies:
browser-stdout "1.3.0"
commander "2.9.0"
debug "2.2.0"
diff "1.4.0"
escape-string-regexp "1.0.5"
glob "7.0.5"
growl "1.9.2"
json3 "3.3.2"
lodash.create "3.1.1"
mkdirp "0.5.1"
supports-color "3.1.2"
ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
os-tmpdir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
private@^0.1.6:
version "0.1.7"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"
regenerate@^1.2.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260"
regenerator-runtime@^0.10.0:
version "0.10.3"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e"
regenerator-transform@0.9.8:
version "0.9.8"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c"
dependencies:
babel-runtime "^6.18.0"
babel-types "^6.19.0"
private "^0.1.6"
regexpu-core@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"
dependencies:
regenerate "^1.2.1"
regjsgen "^0.2.0"
regjsparser "^0.1.4"
regjsgen@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7"
regjsparser@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c"
dependencies:
jsesc "~0.5.0"
repeating@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
dependencies:
is-finite "^1.0.0"
rollup@^0.41.5:
version "0.41.6"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a"
dependencies:
source-map-support "^0.4.0"
slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
source-map-support@^0.4.0, source-map-support@^0.4.2:
version "0.4.14"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef"
dependencies:
source-map "^0.5.6"
source-map@^0.5.0, source-map@^0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
supports-color@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
dependencies:
has-flag "^1.0.0"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
to-fast-properties@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320"
trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
type-detect@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+1
-0
# Change log
### vNEXT
- Add support for calling `gql` as a function [matthewerwin](https://github.com/matthewerwin) in [PR #66](https://github.com/apollographql/graphql-tag/pull/66)

@@ -4,0 +5,0 @@ ### v2.0.0

+1
-1

@@ -155,3 +155,3 @@ (function (global, factory) {

// We always get literals[0] and then matching post literals for each arg given
var result = literals[0];
var result = (typeof(literals) === "string") ? literals : literals[0];

@@ -158,0 +158,0 @@ for (var i = 1; i < args.length; i++) {

@@ -1,1 +0,1 @@

{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.js"],"sourcesContent":["var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc);\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\n\nmodule.exports = gql;\n"],"names":[],"mappings":";;;;;;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,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;EACjC,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;;EAE5B,OAAO,MAAM,CAAC;CACf;;;AAGD,SAAS,GAAG,kBAAkB;EAC5B,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;EAEjD,IAAI,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;;;EAGvB,IAAI,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;;EAEzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACpC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;MAC1D,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;KACnC,MAAM;MACL,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;KACnB;;IAED,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;GACvB;;EAED,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B;;;AAGD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC;AAClB,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;AAC9B,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;;AAEtD,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,;;"}
{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.js"],"sourcesContent":["var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc);\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\n\nmodule.exports = gql;\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;;AAEhD,IAAI,KAAK,GAAG,MAAM,CAAC,KA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OAAO,MAAM,CAAC;CACf;;;AAGD,SAAS,GAAG,kBAAkB;EAC5B,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;EAEjD,IAAI,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;;;EAGvB,IAAI,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,KAAK,QAAQ,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;;EAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACpC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;MAC1D,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;KACnC,MAAM;MACL,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;KACnB;;IAED,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;GACvB;;EAED,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B;;;AAGD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC;AAClB,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;AAC9B,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;;AAEtD,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,;;"}

@@ -10,3 +10,19 @@ "use strict";

const lines = source.split('\n');
let outputCode = "";
let outputCode = `
var names = {};
function unique(defs) {
return defs.filter(
function(def) {
if (def.kind !== 'FragmentDefinition') return true;
var name = def.name.value
if (names[name]) {
return false;
} else {
names[name] = true;
return true;
}
}
)
}
`;

@@ -17,3 +33,3 @@ lines.some((line) => {

const parseDocument = `require(${importFile})`;
const appendDef = `doc.definitions = doc.definitions.concat(${parseDocument}.definitions);`;
const appendDef = `doc.definitions = doc.definitions.concat(unique(${parseDocument}.definitions));`;
outputCode += appendDef + "\n";

@@ -30,3 +46,6 @@ }

const doc = gql`${source}`;
const outputCode = `var doc = ${JSON.stringify(doc)};`;
const outputCode = `
var doc = ${JSON.stringify(doc)};
doc.loc.source = ${JSON.stringify(doc.loc.source)};
`;
const importOutputCode = expandImports(source, doc);

@@ -33,0 +52,0 @@

{
"name": "graphql-tag",
"version": "2.0.0",
"version": "2.1.0",
"description": "A JavaScript template literal tag that parses GraphQL queries",

@@ -5,0 +5,0 @@ "main": "./lib/graphql-tag.umd.js",

@@ -9,4 +9,2 @@ # graphql-tag

- `gql` A JavaScript template literal tag that parses GraphQL query strings into the standard GraphQL AST.
- `/parser` A bundled version of `graphql/language/parser`, that builds correctly in React Native.
- `/printer` A bundled version of `graphql/language/printer`, that builds correctly in React Native.
- `/loader` A webpack loader to preprocess queries

@@ -94,15 +92,1 @@

Testing environments that don't support Webpack require additional configuration. For [Jest](https://facebook.github.io/jest/) use [jest-transform-graphql](https://github.com/remind101/jest-transform-graphql).
### Parser and printer
This package also includes two submodules: `graphql-tag/printer` and `graphql-tag/parser`, which are bundled versions of the corresponding modules from the standard `graphql` package. These are included because the `graphql` package currently doesn't build in **React Native**. Use them the same way you would use the relevant modules from `graphql`:
```js
import { parse } from 'graphql-tag/parser';
import { print } from 'graphql-tag/printer';
```
#### Why are these included in the source on GitHub?
We generate the bundles for the printer and parser with Webpack from the `graphql` package. You might notice the bundles are included in the package source on GitHub. This is to enable easy installation from a Git URL in cases where that is helpful. In the case of updates to `graphql` printing or parsing (which should be very rare since the syntax is stable at this point), we will be able to easily run the build script and republish.

@@ -149,3 +149,3 @@ var parser = require('graphql/language/parser');

// We always get literals[0] and then matching post literals for each arg given
var result = literals[0];
var result = (typeof(literals) === "string") ? literals : literals[0];

@@ -152,0 +152,0 @@ for (var i = 1; i < args.length; i++) {

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
var parser = require('graphql/language/parser');
var parse = parser.parse;
// Strip insignificant whitespace
// Note that this could do a lot more, such as reorder fields etc.
function normalize(string) {
return string.replace(/[\s,]+/g, ' ').trim();
}
// A map docString -> graphql document
var docCache = {};
// A map fragmentName -> [normalized source]
var fragmentSourceMap = {};
function cacheKeyFromLoc(loc) {
return normalize(loc.source.body.substring(loc.start, loc.end));
}
// For testing.
function resetCaches() {
docCache = {};
fragmentSourceMap = {};
}
// Take a unstripped parsed document (query/mutation or even fragment), and
// check all fragment definitions, checking for name->source uniqueness.
// We also want to make sure only unique fragments exist in the document.
var printFragmentWarnings = true;
function processFragments(ast) {
var astFragmentMap = {};
var definitions = [];
for (var i = 0; i < ast.definitions.length; i++) {
var fragmentDefinition = ast.definitions[i];
if (fragmentDefinition.kind === 'FragmentDefinition') {
var fragmentName = fragmentDefinition.name.value;
var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
// We know something about this fragment
if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {
// this is a problem because the app developer is trying to register another fragment with
// the same name as one previously registered. So, we tell them about it.
if (printFragmentWarnings) {
console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
+ "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
+ "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
}
fragmentSourceMap[fragmentName][sourceKey] = true;
} else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {
fragmentSourceMap[fragmentName] = {};
fragmentSourceMap[fragmentName][sourceKey] = true;
}
if (!astFragmentMap[sourceKey]) {
astFragmentMap[sourceKey] = true;
definitions.push(fragmentDefinition);
}
} else {
definitions.push(fragmentDefinition);
}
}
ast.definitions = definitions;
return ast;
}
function disableFragmentWarnings() {
printFragmentWarnings = false;
}
function stripLoc(doc, removeLocAtThisLevel) {
var docType = Object.prototype.toString.call(doc);
if (docType === '[object Array]') {
return doc.map(function (d) {
return stripLoc(d, removeLocAtThisLevel);
});
}
if (docType !== '[object Object]') {
throw new Error('Unexpected input.');
}
// We don't want to remove the root loc field so we can use it
// for fragment substitution (see below)
if (removeLocAtThisLevel && doc.loc) {
delete doc.loc;
}
// https://github.com/apollographql/graphql-tag/issues/40
if (doc.loc) {
delete doc.loc.startToken;
delete doc.loc.endToken;
}
var keys = Object.keys(doc);
var key;
var value;
var valueType;
for (key in keys) {
if (keys.hasOwnProperty(key)) {
value = doc[keys[key]];
valueType = Object.prototype.toString.call(value);
if (valueType === '[object Object]' || valueType === '[object Array]') {
doc[keys[key]] = stripLoc(value, true);
}
}
}
return doc;
}
function parseDocument(doc) {
var cacheKey = normalize(doc);
if (docCache[cacheKey]) {
return docCache[cacheKey];
}
var parsed = parse(doc);
if (!parsed || parsed.kind !== 'Document') {
throw new Error('Not a valid GraphQL document.');
}
// check that all "new" fragments inside the documents are consistent with
// existing fragments of the same name
parsed = processFragments(parsed);
parsed = stripLoc(parsed, false);
docCache[cacheKey] = parsed;
return parsed;
}
// XXX This should eventually disallow arbitrary string interpolation, like Relay does
function gql(/* arguments */) {
var args = Array.prototype.slice.call(arguments);
var literals = args[0];
// We always get literals[0] and then matching post literals for each arg given
var result = literals[0];
for (var i = 1; i < args.length; i++) {
if (args[i] && args[i].kind && args[i].kind === 'Document') {
result += args[i].loc.source.body;
} else {
result += args[i];
}
result += literals[i];
}
return parseDocument(result);
}
// Support typescript, which isn't as nice as Babel about default exports
gql.default = gql;
gql.resetCaches = resetCaches;
gql.disableFragmentWarnings = disableFragmentWarnings;
module.exports = gql;
})));
//# sourceMappingURL=graphql-tag.umd.js.map
{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.js"],"sourcesContent":["var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc);\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\n\nmodule.exports = gql;\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;;AAEhD,IAAI,KAAK,GAAG,MAA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