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

@shopify/react-graphql

Package Overview
Dependencies
Maintainers
13
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-graphql - npm Package Compare versions

Comparing version 5.2.0-beta.3 to 5.2.0-beta.4

dist/ApolloContext.d.ts.map

3

dist/index.d.ts

@@ -5,6 +5,7 @@ export { DeferTiming } from '@shopify/async';

export { createAsyncQueryComponent } from './async';
export { AsyncQueryComponentType, GraphQLData, GraphQLVariables, GraphQLDeepPartial, QueryProps, } from './types';
export { AsyncQueryComponentType, GraphQLData, GraphQLVariables, GraphQLDeepPartial, QueryProps, GraphQLOperationDetails, } from './types';
export { ApolloProvider } from './ApolloProvider';
export { GraphQLOperationsContext } from './graphql-operations-context';
export * from './hooks';
export * from './links';
export * from './utilities';

@@ -14,4 +14,6 @@ "use strict";

exports.ApolloProvider = ApolloProvider_1.ApolloProvider;
var graphql_operations_context_1 = require("./graphql-operations-context");
exports.GraphQLOperationsContext = graphql_operations_context_1.GraphQLOperationsContext;
tslib_1.__exportStar(require("./hooks"), exports);
tslib_1.__exportStar(require("./links"), exports);
tslib_1.__exportStar(require("./utilities"), exports);
import { ApolloLink } from 'apollo-link';
export interface GraphQLOperation {
name: string;
duration: number;
start: number;
end: number;
success: boolean;
errors?: {
message: string;
path?: string;
}[];
url?: string;
status?: number;
requestId?: string;
}
import { GraphQLOperationDetails } from '../types';
export interface Options {
requestIdHeader?: string;
onOperation(operation: GraphQLOperation): void;
onOperation(operation: GraphQLOperationDetails): void;
}
export declare function createOperationDetailsLink({ onOperation, requestIdHeader, }: Options): ApolloLink;
export declare function createOperationDetailsLink({ onOperation }: Options): ApolloLink;

@@ -5,4 +5,5 @@ "use strict";

var performance_1 = require("@shopify/performance");
var network_1 = require("@shopify/network");
function createOperationDetailsLink(_a) {
var onOperation = _a.onOperation, requestIdHeader = _a.requestIdHeader;
var onOperation = _a.onOperation;
return new apollo_link_1.ApolloLink(function (operation, forward) {

@@ -28,4 +29,3 @@ if (forward == null) {

var requestId = response instanceof Response
? (requestIdHeader && response.headers.get(requestIdHeader)) ||
undefined
? response.headers.get(network_1.Header.RequestId) || undefined
: undefined;

@@ -32,0 +32,0 @@ var status = response instanceof Response ? response.status : undefined;

@@ -33,1 +33,15 @@ import React from 'react';

}
export interface GraphQLOperationDetails {
name: string;
duration: number;
start: number;
end: number;
success: boolean;
errors?: {
message: string;
path?: string;
}[];
url?: string;
status?: number;
requestId?: string;
}

@@ -1,15 +0,2 @@

export interface GraphQLOperationDetails {
name: string;
duration: number;
start: number;
end: number;
success: boolean;
errors?: {
message: string;
path?: string;
}[];
url?: string;
status?: number;
requestId?: string;
}
import { GraphQLOperationDetails } from '../types';
export declare function totalGraphQLTime(operations: GraphQLOperationDetails[]): number;
{
"name": "@shopify/react-graphql",
"version": "5.2.0-beta.3",
"version": "5.2.0-beta.4",
"license": "MIT",

@@ -31,3 +31,2 @@ "description": "Tools for creating type-safe and asynchronous GraphQL components for React.",

"@shopify/react-hooks": "^1.2.3",
"@shopify/react-network": "^3.2.2",
"@shopify/useful-types": "^2.0.1",

@@ -34,0 +33,0 @@ "apollo-cache-inmemory": "^1.6.2",

@@ -130,3 +130,3 @@ # `@shopify/react-graphql`

Using Apollo Hooks assume the usage of [`react-apollo`](https://github.com/apollographql/react-apollo))
Using Apollo Hooks assume the usage of [`react-apollo`](https://github.com/apollographql/react-apollo)

@@ -359,1 +359,22 @@ ### `ApolloProvider`

```
## `createOperationDetailsLink` Apollo Link
This library also provides a custom Apollo Link, `createOperationDetailsLink`. This link takes in an `onOperation` function callback which called with a GraphQL operation of type `GraphQLOperation`.
```tsx
import import {
createOperationDetailsLink,
GraphQLOperationDetails,
} from '@shopify/react-graphql';
const link = createOperationDetailsLink({
onOperation(operation: GraphQLOperationDetails) {
console.log('Look, a GraphQL operation: ', operation);
},
});
// create ApolloClient using this link
```
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