Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New packages: @apollo/generate-persisted-query-manifest and @apollo/persisted-query-lists #287

Merged
merged 30 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f4a710d
Persisted Query List prototype
glasser May 25, 2023
82ebf30
Implement createPersistedQueryManifestVerificationLink
glasser May 26, 2023
264c866
Make alpha releases from the branch.
glasser May 26, 2023
cd22cf4
Version Packages (alpha) (#288)
github-actions[bot] May 26, 2023
ca2fa6a
Load manifest async
glasser May 26, 2023
ba07002
Test error in lazy load
glasser May 26, 2023
9b5c8d9
changeset
glasser May 26, 2023
cef21e8
Version Packages (alpha) (#289)
github-actions[bot] May 26, 2023
f72c2d0
Allow v3.8.0 prerelease versions of `@apollo/client` (#291)
jerelmiller May 31, 2023
bef53e4
Add `@apollo/persisted-query-lists` as a dependency (#293)
jerelmiller May 31, 2023
f10d9c4
Version Packages (alpha) (#292)
github-actions[bot] May 31, 2023
ee6aa59
simplify tests (thanks Jerel)
glasser May 26, 2023
fb4f6da
Change generatePersistedQueryIdsFromManifest to async manifest; fix P…
glasser Jun 2, 2023
a8f712e
Version Packages (alpha) (#294)
github-actions[bot] Jun 2, 2023
c41dd06
Add support for a config file to the `generate-persisted-query-manife…
jerelmiller Jun 2, 2023
3d8dbf5
Version Packages (alpha) (#296)
github-actions[bot] Jun 2, 2023
4e04986
Merge remote-tracking branch 'origin/main' into glasser/persisted-que…
jerelmiller Jun 12, 2023
3057433
Better error handling when encountering errors during manifest genera…
jerelmiller Jun 12, 2023
9558d6d
Version Packages (alpha) (#307)
github-actions[bot] Jun 12, 2023
b5ca31c
Conslidate verification failure callbacks in `createPersistedQueryMan…
jerelmiller Jun 14, 2023
18981ce
Add ability create custom manifest operation IDs (#309)
jerelmiller Jun 15, 2023
3ca46e3
Allow persisted query manifest to be loaded synchronously (#313)
jerelmiller Jun 22, 2023
beb30d4
Add documentation for `@apollo/generate-persisted-query-manifest` to …
jerelmiller Jun 22, 2023
12b76e2
Add changeset for #313 (#315)
jerelmiller Jun 22, 2023
cc4d393
Version Packages (alpha) (#310)
github-actions[bot] Jun 22, 2023
d517125
Consolidate `documents` and `documentIgnorePatterns` in manifest conf…
jerelmiller Jul 6, 2023
3750d38
Version Packages (alpha) (#318)
github-actions[bot] Jul 7, 2023
beb39e5
Add documentation for `@apollo/persisted-query-lists` (#319)
jerelmiller Jul 7, 2023
798a85a
Merge remote-tracking branch 'origin/main' into glasser/persisted-que…
glasser Jul 7, 2023
320b539
Exit 'pre' mode and stop running releases on the branch
glasser Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/cuddly-pillows-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@apollo/generate-persisted-query-manifest": patch
"@apollo/persisted-query-lists": patch
---

Change `generatePersistedQueryIdsFromManifest` to take an async `loadManifest`. Ensure Promises don't have unhandled rejections.
5 changes: 5 additions & 0 deletions .changeset/few-rings-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/persisted-query-lists": patch
---

Allow the persisted query manifest to be loaded synchronously for both `createPersistedQueryManifestVerificationLink` and `generatePersistedQueryIdsFromManifest`.
5 changes: 5 additions & 0 deletions .changeset/fifty-gorillas-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/generate-persisted-query-manifest": patch
---

Consolidate `document` and `documentIgnorePatterns` to the `documents` option. `documents` patterns can now be prefixed with `!` to negate the pattern.
5 changes: 5 additions & 0 deletions .changeset/great-onions-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/generate-persisted-query-manifest": patch
---

Add `@apollo/persisted-query-lists` as a dependency to fix missing dependency issue.
6 changes: 6 additions & 0 deletions .changeset/khaki-cows-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@apollo/generate-persisted-query-manifest": major
"@apollo/persisted-query-lists": major
---

Initial release
6 changes: 6 additions & 0 deletions .changeset/mighty-rockets-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@apollo/generate-persisted-query-manifest": patch
"@apollo/persisted-query-lists": patch
---

Change createPersistedQueryManifestVerificationLink to load manifest asynchronously.
5 changes: 5 additions & 0 deletions .changeset/moody-pots-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/generate-persisted-query-manifest": patch
---

Adds support for a config file to the CLI. This can be used to determine where the CLI should look for GraphQL operations and where the manifest file should be written. The CLI has the ability to specify the path to the config file.
36 changes: 36 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"mode": "exit",
"tag": "alpha",
"initialVersions": {
"@apollo/utils.createhash": "3.0.0",
"@apollo/utils.dropunuseddefinitions": "3.0.0",
"@apollo/utils.fetcher": "3.0.0",
"@apollo/generate-persisted-query-manifest": "0.0.0",
"@apollo/utils.isnodelike": "3.0.0",
"@apollo/utils.jest-graphql-ast-serializer": "3.0.0",
"@apollo/utils.keyvaluecache": "3.0.0",
"@apollo/utils.keyvadapter": "3.0.0",
"@apollo/utils.logger": "3.0.0",
"@apollo/utils.operationregistrysignature": "3.0.0",
"@apollo/persisted-query-lists": "0.0.0",
"@apollo/utils.printwithreducedwhitespace": "3.0.0",
"@apollo/utils.removealiases": "3.0.0",
"@apollo/utils.sortast": "3.0.0",
"@apollo/utils.stripsensitiveliterals": "3.0.0",
"@apollo/utils.usagereporting": "3.0.0",
"@apollo/utils.withrequired": "3.0.0"
},
"changesets": [
"cuddly-pillows-mix",
"few-rings-accept",
"fifty-gorillas-sell",
"great-onions-punch",
"khaki-cows-suffer",
"mighty-rockets-sing",
"moody-pots-promise",
"selfish-knives-flow",
"strong-eyes-play",
"twenty-ligers-sip",
"weak-monkeys-reflect"
]
}
6 changes: 6 additions & 0 deletions .changeset/selfish-knives-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@apollo/generate-persisted-query-manifest": patch
"@apollo/persisted-query-lists": patch
---

Allow v3.8.0 prerelease versions of @apollo/client.
20 changes: 20 additions & 0 deletions .changeset/strong-eyes-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@apollo/persisted-query-lists": patch
---

**`createPersistedQueryManifestVerificationLink`**

- Consolidate the callbacks to a single `onVerificationFailed` callback with a `reason` property that describes the verification failure.
- The full `operation` is now available as a property to the `onVerificationFailed` callback.

```ts
createPersistedQueryManifestVerificationLink({
onVerificationFailed(details) {
// The reason the verification failed, such as an anonymous operation
console.log(details.reason)

// The operation that caused the verification failure
console.log(details.operation)
}
})
```
24 changes: 24 additions & 0 deletions .changeset/twenty-ligers-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"@apollo/generate-persisted-query-manifest": patch
---

Add the ability to create custom manifest operation IDs by defining a `createCustomId` function in the config file.

```ts
// persisted-query-manifest.config.ts
import { PersistedQueryManifestConfig } from '@apollo/generate-persisted-query-manifest';
import { Buffer } from 'node:buffer'

const config: PersistedQueryManifestConfig = {
createOperationId(query, { operationName, createDefaultId }) {
switch (operationName) {
case 'TestOperation':
return Buffer.from(query).toString('base64');
default:
return createDefaultId();
}
}
}

export default config;
```
8 changes: 8 additions & 0 deletions .changeset/weak-monkeys-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@apollo/generate-persisted-query-manifest": patch
---

Provides more robust error handling and reporting.

* Collect all errors while generating manifest and report them together at once. Previously it would exit as soon as an error was encountered, even if there were multiple issues.
* Update the error reporting format to make it much easier to determine which file contains the error.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ renovate.json5

# generated by changesets
CHANGELOG.md
.changeset/

.volta
Loading