graphql-tag
Advanced tools
Comparing version 2.4.2 to 2.5.0
# Change log | ||
### v2.5.0 | ||
- Update graphql to ^0.11.0, add graphql@^0.11.0 to peerDependencies [pleunv](https://github.com/pleunv) in [PR #124](https://github.com/apollographql/graphql-tag/pull/124) | ||
### v2.4.{1,2} | ||
@@ -3,0 +6,0 @@ - Temporarily reverting [PR #99](https://github.com/apollographql/graphql-tag/pull/99) to investigate issues with bundling |
{ | ||
"name": "graphql-tag", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"description": "A JavaScript template literal tag that parses GraphQL queries", | ||
@@ -28,9 +28,9 @@ "main": "./lib/graphql-tag.umd.js", | ||
"chai": "^4.0.2", | ||
"graphql": "^0.10.0", | ||
"graphql": "^0.11.0", | ||
"mocha": "^3.4.1", | ||
"rollup": "^0.42.0" | ||
"rollup": "^0.45.0" | ||
}, | ||
"peerDependencies": { | ||
"graphql": "^0.9.0 || ^0.10.0" | ||
"graphql": "^0.9.0 || ^0.10.0 || ^0.11.0" | ||
} | ||
} |
@@ -65,5 +65,21 @@ # graphql-tag | ||
### Babel preprocessing | ||
GraphQL queries can be compiled at build time using [babel-plugin-graphql-tag](https://github.com/gajus/babel-plugin-graphql-tag). Pre-compiling queries decreases the script initialization time and reduces the bundle size by potentially removing the need for `graphql-tag` at runtime. | ||
#### React Native, Next.js | ||
Additionally, in certain situations, preprocessing queries via the webpack loader is not possible. [babel-plugin-inline-import-graphql-ast](https://www.npmjs.com/package/babel-plugin-inline-import-graphql-ast) will allow one to import graphql files directly into your JavaScript by preprocessing GraphQL queries into ASTs at compile-time. | ||
E.g.: | ||
```javascript | ||
import myImportedQuery from './productsQuery.graphql' | ||
class ProductsPage extends React.Component { | ||
... | ||
} | ||
``` | ||
### Webpack preprocessing | ||
This package also includes a [webpack loader](https://webpack.github.io/docs/loaders.html). There are many benefits over this approach, which saves GraphQL ASTs processing time on client-side and enable queries to be separated from script over `.graphql` files. | ||
This package also includes a [webpack loader](https://webpack.js.org/concepts/loaders). There are many benefits over this approach, which saves GraphQL ASTs processing time on client-side and enable queries to be separated from script over `.graphql` files. | ||
@@ -70,0 +86,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72561
117