Skip to content

Commit

Permalink
Remove graphql peers from exchanges (except populate)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Mar 24, 2023
1 parent a0d6b33 commit dee2f09
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 29 deletions.
3 changes: 0 additions & 3 deletions exchanges/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
Expand Down
8 changes: 3 additions & 5 deletions exchanges/auth/src/authExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import {
OperationResult,
CombinedError,
Exchange,
TypedDocumentNode,
DocumentInput,
AnyVariables,
} from '@urql/core';

import { DocumentNode } from 'graphql';

/** Utilities to use while refreshing authentication tokens. */
export interface AuthUtilities {
/** Sends a mutation to your GraphQL API, bypassing earlier exchanges and authentication.
Expand All @@ -43,7 +41,7 @@ export interface AuthUtilities {
* options, so you may have to pass them again, if needed.
*/
mutate<Data = any, Variables extends AnyVariables = AnyVariables>(
query: DocumentNode | TypedDocumentNode<Data, Variables> | string,
query: DocumentInput<Data, Variables>,
variables: Variables,
context?: Partial<OperationContext>
): Promise<OperationResult<Data>>;
Expand Down Expand Up @@ -222,7 +220,7 @@ export function authExchange(
.then(() =>
init({
mutate<Data = any, Variables extends AnyVariables = AnyVariables>(
query: DocumentNode | string,
query: DocumentInput<Data, Variables>,
variables: Variables,
context?: Partial<OperationContext>
): Promise<OperationResult<Data>> {
Expand Down
3 changes: 0 additions & 3 deletions exchanges/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
Expand Down
3 changes: 0 additions & 3 deletions exchanges/multipart-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
"extract-files": "^11.0.0",
"wonka": "^6.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
Expand Down
3 changes: 0 additions & 3 deletions exchanges/persisted/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
Expand Down
8 changes: 5 additions & 3 deletions exchanges/persisted/src/persistedExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import {
makeOperation,
stringifyDocument,
PersistedRequestExtensions,
TypedDocumentNode,
OperationResult,
CombinedError,
Exchange,
Operation,
} from '@urql/core';

import type { DocumentNode } from 'graphql';

import { hash } from './sha256';

const isPersistedMiss = (error: CombinedError): boolean =>
Expand Down Expand Up @@ -67,7 +66,10 @@ export interface PersistedExchangeOptions {
* API is unavailable on React Native, which may require you to
* pass a custom function here.
*/
generateHash?(query: string, document: DocumentNode): Promise<string>;
generateHash?(
query: string,
document: TypedDocumentNode<any, any>
): Promise<string>;
/** Enables persisted queries to be used for mutations.
*
* @remarks
Expand Down
3 changes: 0 additions & 3 deletions exchanges/refocus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
"@types/react": "^17.0.4",
"graphql": "^16.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
Expand Down
3 changes: 0 additions & 3 deletions exchanges/request-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
Expand Down
3 changes: 0 additions & 3 deletions exchanges/retry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
"@urql/core": "workspace:*",
"graphql": "^16.0.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
"@urql/core": ">=3.2.2",
"wonka": "^6.0.0"
Expand Down

0 comments on commit dee2f09

Please sign in to comment.