Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/ninety-geese-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'apollo-angular': minor
---

Compatibility with GraphQL 17
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
strategy:
matrix:
angular_version: [20, 21, 22]
graphql_version: [16]
graphql_version: [16, 17]
node_version: [20, 22, 24, 26]
exclude:
- angular_version: 20
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
},
"peerDependencies": {
"@angular/core": "^20.0.0 || ^21.0.0 || ^22.0.0",
"@apollo/client": "^4.0.1",
"graphql": "^16.0.0",
"@apollo/client": "^4.2.3",
"graphql": "^16.0.0 || ^17.0.0",
"rxjs": "^7.8.0"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-angular/schematics/install/index.cts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function factory(options: Schema): Rule {
export function createDependenciesMap(options: Schema): Record<string, string> {
return {
'apollo-angular': '^9.0.0',
'@apollo/client': '^4.0.1',
graphql: `^${options.graphql ?? '16.0.0'}`,
'@apollo/client': '^4.2.3',
graphql: `^${options.graphql ?? '17.0.0'}`,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-angular/schematics/install/schema.cts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export interface Schema {
project: string;
/** Url to your GraphQL endpoint */
endpoint?: string;
/** Version of GraphQL (16 by default) */
/** Version of GraphQL (17 by default) */
graphql?: string;
}
4 changes: 2 additions & 2 deletions packages/apollo-angular/schematics/install/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"graphql": {
"type": "string",
"minLength": 0,
"default": "16",
"minLength": 2,
"default": "17",
"x-prompt": "Version of GraphQL"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-angular/schematics/tests/ng-add.spec.cts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('ng-add with standalone', () => {

const dependenciesMap = createDependenciesMap({
project: 'my-project',
graphql: '16',
graphql: '17',
});

for (const dependency in dependenciesMap) {
Expand Down
1 change: 1 addition & 0 deletions packages/apollo-angular/src/only-complete-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ export const onlyComplete = onlyCompleteData;
* Same as `onlyCompleteData()` but for `Apollo.watchFragment()`.
*/
export function onlyCompleteFragment<TData>(): ForWatchFragment<TData> {
// @ts-expect-error
return filter((result): result is CompleteFragment<TData> => result.dataState === 'complete');
}
4 changes: 1 addition & 3 deletions packages/apollo-angular/test-utils/ObservableStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export interface TakeOptions {
timeout?: number;
}
type ObservableEvent<T> =
| { type: 'next'; value: T }
| { type: 'error'; error: any }
| { type: 'complete' };
{ type: 'next'; value: T } | { type: 'error'; error: any } | { type: 'complete' };

function formatMessage(expected: ObservableEvent<any>, actual: ObservableEvent<any>) {
return printDiffOrStringify(expected, actual, { expand: true });
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/core": "^20.3.0",
"@angular/platform-browser": "^20.3.0",
"@angular/router": "^20.3.0",
"@apollo/client": "^4.0.1",
"@apollo/client": "^4.2.10",
"apollo-angular": "workspace:*",
"typescript": "~5.8.0"
}
Expand Down
3,308 changes: 1,691 additions & 1,617 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions scripts/run-e2e-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ rm -rf /tmp/testapp

(cd /tmp/ && ng new testapp --package-manager pnpm --defaults --minimal --skip-git)
cp apollo-angular.tgz /tmp/testapp/
(cd /tmp/testapp && ng add /tmp/testapp/apollo-angular.tgz --graphql '16.0.0' --defaults --verbose --skip-confirmation)
(cd /tmp/testapp && ng add /tmp/testapp/apollo-angular.tgz --graphql '17.0.0' --defaults --verbose --skip-confirmation)
(cd /tmp/testapp && pnpm ng run testapp:build:production)
(cd /tmp/testapp && ng add @cypress/schematic --defaults --verbose --skip-confirmation)
./scripts/prepare-e2e.js /tmp/testapp 16
(cd /tmp/testapp && pnpm_config_ignore_scripts=true ng add @cypress/schematic --defaults --verbose --skip-confirmation)
./scripts/prepare-e2e.js /tmp/testapp 17
(cd /tmp/testapp && pnpm cypress install)
(cd /tmp/testapp && pnpm ng run testapp:cypress-run:production)
rm -rf /tmp/testapp
8 changes: 2 additions & 6 deletions website/src/pages/docs/recipes/multiple-clients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,10 @@ export class AppComponent {

constructor(apollo: Apollo) {
// use default
this.feedQuery = apollo.watchQuery({
/* ... */
});
this.feedQuery = apollo.watchQuery({/* ... */});

// use extra client
this.feedQuery = apollo.use('myAlternativeGraphQl').watchQuery({
/* ... */
});
this.feedQuery = apollo.use('myAlternativeGraphQl').watchQuery({/* ... */});
}
}
```
Loading