Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-react

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-react - npm Package Compare versions

Comparing version 8.0.0 to 8.0.1

14

changelog.md
# graphql-react changelog
## 8.0.1
### Patch
- Updated dev dependencies.
- `useGraphQL` React hook bug fixes for when arguments change after the initial render:
- Changes that cause the `cacheKey` to change trigger a reload if the `loadOnMount` option is `true`, fixing [#23](https://github.com/jaydenseric/graphql-react/issues/23).
- Fixed stale operation status properties being returned.
- Use [`react-test-renderer`](https://npm.im/react-test-renderer) to test `useGraphQL` with a lot more detail.
- Capitalized the `React` namespace in `useGraphQL`.
- Improved `hashObject()` tests.
## 8.0.0

@@ -7,3 +19,3 @@

- Updated the `react` and `react-dom` peer dependencies to `^16.8.0`.
- Updated the [`react`](https://npm.im/react) and [`react-dom`](https://npm.im/react-dom) peer dependencies to `^16.8.0`.
- Removed the `Query` component.

@@ -10,0 +22,0 @@ - No longer exporting `Provider` and `Consumer`; now `GraphQLContext` is exported.

13

package.json
{
"name": "graphql-react",
"version": "8.0.0",
"version": "8.0.1",
"description": "A lightweight but powerful GraphQL client for React using modern context and hooks APIs; the first Relay and Apollo alternative with server side rendering.",

@@ -51,4 +51,4 @@ "license": "MIT",

"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",

@@ -61,3 +61,3 @@ "@babel/plugin-transform-runtime": "^7.2.0",

"cross-fetch": "^3.0.1",
"eslint": "^5.13.0",
"eslint": "^5.14.1",
"eslint-config-env": "^3.0.0",

@@ -71,3 +71,3 @@ "eslint-config-prettier": "^4.0.0",

"eslint-plugin-react-hooks": "^1.0.2",
"formdata-node": "^1.4.0",
"formdata-node": "^1.4.1",
"graphql": "^14.1.1",

@@ -83,4 +83,5 @@ "graphql-api-koa": "^2.0.0",

"react-dom": "^16.8.2",
"react-test-renderer": "^16.8.2",
"size-limit": "^0.21.1",
"tap": "^12.5.2"
"tap": "^12.5.3"
},

@@ -87,0 +88,0 @@ "scripts": {

@@ -36,17 +36,24 @@ 'use strict'

if (fetchOptionsOverride) fetchOptionsOverride(fetchOptions)
var fetchOptionsHash = (0, _hashObject.hashObject)(fetchOptions)
var _react$useState = _react.default.useState(
(0, _hashObject.hashObject)(fetchOptions)
var _React$useState = _react.default.useState(fetchOptionsHash),
cacheKey = _React$useState[0],
setCacheKey = _React$useState[1]
var _React$useState2 = _react.default.useState(graphql.cache[cacheKey]),
cacheValue = _React$useState2[0],
setCacheValue = _React$useState2[1]
var _React$useState3 = _react.default.useState(
cacheKey in graphql.operations || loadOnMount
),
cacheKey = _react$useState[0],
setCacheKey = _react$useState[1]
loading = _React$useState3[0],
setLoading = _React$useState3[1]
var _react$useState2 = _react.default.useState(graphql.cache[cacheKey]),
cacheValue = _react$useState2[0],
setCacheValue = _react$useState2[1]
if (cacheKey !== fetchOptionsHash) {
setCacheKey((cacheKey = fetchOptionsHash))
setCacheValue((cacheValue = graphql.cache[cacheKey]))
setLoading((loading = cacheKey in graphql.operations || loadOnMount))
}
var _react$useState3 = _react.default.useState(loadOnMount),
loading = _react$useState3[0],
setLoading = _react$useState3[1]
var operate = function operate() {

@@ -98,3 +105,2 @@ return graphql.operate({

graphql.on('reset', onReset)
if (loadOnMount) load()
return function() {

@@ -107,2 +113,9 @@ graphql.off('fetch', onFetch)

_react.default.useEffect(
function() {
if (loadOnMount) load()
},
[cacheKey]
)
if (graphql.ssr && loadOnMount && !cacheValue) operate()

@@ -109,0 +122,0 @@ return {

Sorry, the diff of this file is not supported yet

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