graphql-tag 2.10.0 → 2.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/index.d.ts +20 -3
- package/loader.js +7 -1
- package/package.json +5 -5
- package/test/graphql.js +394 -398
- package/.editorconfig +0 -7
- package/.flowconfig +0 -8
- package/.github/ISSUE_TEMPLATE.md +0 -18
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- package/.tav.yml +0 -10
- package/test/graphql-v0.11.js +0 -137
- package/test/graphql-v0.12.js +0 -138
- package/yarn.lock +0 -1141
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
-
### v2.
|
|
3
|
+
### v2.10.3 (2020-02-05)
|
|
4
|
+
|
|
5
|
+
* Further adjustments to the TS `index.d.ts` declaration file. <br/>
|
|
6
|
+
[@Guillaumez](https://github.com/Guillaumez) in [#289](https://github.com/apollographql/graphql-tag/pull/289)
|
|
7
|
+
|
|
8
|
+
### v2.10.2 (2020-02-04)
|
|
9
|
+
|
|
10
|
+
* Update/fix the existing TS `index.d.ts` declaration file. <br/>
|
|
11
|
+
[@hwillson](https://github.com/hwillson) in [#285](https://github.com/apollographql/graphql-tag/pull/285)
|
|
12
|
+
|
|
13
|
+
### v2.10.1
|
|
14
|
+
|
|
15
|
+
* Fix failures in IE11 by avoiding unsupported (by IE11) constructor arguments to `Set` by [rocwang](https://github.com/rocwang) in [#190](https://github.com/apollographql/graphql-tag/pull/190)
|
|
16
|
+
|
|
17
|
+
### v2.10.0
|
|
18
|
+
* Add support for `graphql@14` by [timsuchanek](https://github.com/timsuchanek) in [#210](https://github.com/apollographql/graphql-tag/pull/210), [#211](https://github.com/apollographql/graphql-tag/pull/211)
|
|
19
|
+
|
|
20
|
+
### v2.9.1
|
|
4
21
|
* Fix IE11 support by using a regular for-loop by [vitorbal](https://github.com/vitorbal) in [#176](https://github.com/apollographql/graphql-tag/pull/176)
|
|
5
22
|
|
|
6
23
|
### v2.9.0
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2020 Meteor Development Group, Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -52,11 +52,11 @@ console.log(query);
|
|
|
52
52
|
|
|
53
53
|
You can easily explore GraphQL ASTs on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1).
|
|
54
54
|
|
|
55
|
-
This package is the way to pass queries into [Apollo Client](https://github.com/
|
|
55
|
+
This package is the way to pass queries into [Apollo Client](https://github.com/apollographql/apollo-client). If you're building a GraphQL client, you can use it too!
|
|
56
56
|
|
|
57
57
|
#### Why use this?
|
|
58
58
|
|
|
59
|
-
GraphQL strings are the right way to write queries in your code, because they can be statically analyzed using tools like [eslint-plugin-graphql](https://github.com/
|
|
59
|
+
GraphQL strings are the right way to write queries in your code, because they can be statically analyzed using tools like [eslint-plugin-graphql](https://github.com/apollographql/eslint-plugin-graphql). However, strings are inconvenient to manipulate, if you are trying to do things like add extra fields, merge multiple queries together, or other interesting stuff.
|
|
60
60
|
|
|
61
61
|
That's where this package comes in - it lets you write your queries with [ES2015 template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) and compile them into an AST with the `gql` tag.
|
|
62
62
|
|
|
@@ -86,7 +86,7 @@ class ProductsPage extends React.Component {
|
|
|
86
86
|
|
|
87
87
|
#### Create-React-App
|
|
88
88
|
|
|
89
|
-
`create-react-app@2.0.0`
|
|
89
|
+
`create-react-app@2.0.0` does support the ability to preprocess queries using [evenchange4/graphql.macro](https://github.com/evenchange4/graphql.macro).
|
|
90
90
|
|
|
91
91
|
If you're using an older version of `create-react-app`, check out [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast) to preprocess queries without needing to eject.
|
|
92
92
|
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare module "graphql-tag" {
|
|
2
|
+
function gql(
|
|
3
|
+
literals: ReadonlyArray<string> | Readonly<string>,
|
|
4
|
+
...placeholders: any[]
|
|
5
|
+
): import("graphql").DocumentNode;
|
|
6
|
+
|
|
7
|
+
namespace gql {
|
|
8
|
+
function resetCaches(): void;
|
|
9
|
+
function disableFragmentWarnings(): void;
|
|
10
|
+
function enableExperimentalFragmentVariables(): void;
|
|
11
|
+
function disableExperimentalFragmentVariables(): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default gql;
|
|
15
|
+
|
|
16
|
+
export function resetCaches(): void;
|
|
17
|
+
export function disableFragmentWarnings(): void;
|
|
18
|
+
export function enableExperimentalFragmentVariables(): void;
|
|
19
|
+
export function disableExperimentalFragmentVariables(): void;
|
|
20
|
+
}
|
package/loader.js
CHANGED
|
@@ -130,7 +130,13 @@ module.exports = function(source) {
|
|
|
130
130
|
// it or the fragments it references
|
|
131
131
|
var opRefs = definitionRefs[operationName] || new Set();
|
|
132
132
|
var allRefs = new Set();
|
|
133
|
-
var newRefs = new Set(
|
|
133
|
+
var newRefs = new Set();
|
|
134
|
+
|
|
135
|
+
// IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one
|
|
136
|
+
opRefs.forEach(function(refName) {
|
|
137
|
+
newRefs.add(refName);
|
|
138
|
+
});
|
|
139
|
+
|
|
134
140
|
while (newRefs.size > 0) {
|
|
135
141
|
var prevRefs = newRefs;
|
|
136
142
|
newRefs = new Set();
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-tag",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.3",
|
|
4
4
|
"description": "A JavaScript template literal tag that parses GraphQL queries",
|
|
5
5
|
"main": "./lib/graphql-tag.umd.js",
|
|
6
6
|
"module": "./src/index.js",
|
|
7
7
|
"jsnext:main": "./src/index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"bundle": "rollup -c && cp src/index.js.flow lib/graphql-tag.umd.js.flow",
|
|
10
|
-
"test": "mocha test/graphql.js
|
|
10
|
+
"test": "mocha test/graphql.js",
|
|
11
11
|
"prepublish": "npm run bundle"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/
|
|
15
|
+
"url": "git+https://github.com/apollographql/graphql-tag.git"
|
|
16
16
|
},
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/apollographql/graphql-tag/issues"
|
|
21
21
|
},
|
|
22
|
-
"homepage": "https://github.com/
|
|
22
|
+
"homepage": "https://github.com/apollographql/graphql-tag#readme",
|
|
23
23
|
"dependencies": {},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"babel-preset-es2015": "^6.9.0",
|