Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.4.2 to 2.5.0

3

CHANGELOG.md
# 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

8

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc