Skip to content

Add new CompositionOption to bail if total number of subgraph path infos in the stack gets above a configured value.#3254

Merged
clenfest merged 6 commits into
mainfrom
clenfest/max_validation_subgraph_paths
Jun 3, 2025
Merged

Add new CompositionOption to bail if total number of subgraph path infos in the stack gets above a configured value.#3254
clenfest merged 6 commits into
mainfrom
clenfest/max_validation_subgraph_paths

Conversation

@clenfest

Copy link
Copy Markdown
Contributor

No description provided.

…fos in the stack gets above a configured value.
@changeset-bot

changeset-bot Bot commented May 13, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a657a82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@apollo/composition Patch
@apollo/federation-internals Patch
@apollo/gateway Patch
@apollo/query-planner Patch
@apollo/query-graphs Patch
@apollo/subgraph Patch
apollo-federation-integration-testsuite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svc-apollo-docs

svc-apollo-docs commented May 13, 2025

Copy link
Copy Markdown

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 88dcda14f9857e3a84b1d6e7

@codesandbox-ci

codesandbox-ci Bot commented May 13, 2025

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@clenfest
clenfest marked this pull request as ready for review May 14, 2025 15:36
@clenfest
clenfest requested a review from a team as a code owner May 14, 2025 15:36
@clenfest
clenfest marked this pull request as draft May 14, 2025 16:00
@clenfest
clenfest marked this pull request as ready for review May 14, 2025 17:01
@sachindshinde
sachindshinde self-requested a review May 14, 2025 17:12

@duckki duckki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look reasonable. Just a question.

Comment thread composition-js/src/validate.ts

@sachindshinde sachindshinde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that #3258 should help for the subgraph path issues we've been considering, but it would still be good to have this limit if there's other undiscovered issues.

Comment thread composition-js/src/compose.ts Outdated
Comment thread composition-js/src/validate.ts Outdated
Comment thread composition-js/src/validate.ts
@clenfest
clenfest merged commit b26794c into main Jun 3, 2025
@clenfest
clenfest deleted the clenfest/max_validation_subgraph_paths branch June 3, 2025 15:55
@github-actions github-actions Bot mentioned this pull request Jun 3, 2025
dariuszkuc pushed a commit that referenced this pull request Jun 24, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/composition@2.11.1

### Patch Changes

- Adding new CompositionOption `maxValidationSubgraphPaths`. This value
represents the maximum number of SubgraphPathInfo objects that may exist
in a ValidationTraversal when checking for satisfiability. Setting this
value can help composition error before running out of memory. Default
is 1,000,000.
([#3254](#3254))

- Fix bug in composition where, when a field's type in a subgraph is a
subtype of the field's type in the supergraph, the satisfiability
validation spuriously succeeds/errors.
([#3277](#3277))

- Updated dependencies
\[[`7799ad1717becf15fb0e82f89619f2ec8a24b4d4`](7799ad1),
[`b26794c5724ef23d1f0fd45a40aee3d301557489`](b26794c),
[`51bed5be49d8e87adae59f568315c9e3488a91e0`](51bed5b)]:
    -   @apollo/federation-internals@2.11.1
    -   @apollo/query-graphs@2.11.1

## @apollo/gateway@2.11.1

### Patch Changes

- Updated dependencies
\[[`7799ad1717becf15fb0e82f89619f2ec8a24b4d4`](7799ad1),
[`b26794c5724ef23d1f0fd45a40aee3d301557489`](b26794c),
[`51bed5be49d8e87adae59f568315c9e3488a91e0`](51bed5b)]:
    -   @apollo/federation-internals@2.11.1
    -   @apollo/composition@2.11.1
    -   @apollo/query-planner@2.11.1

## @apollo/federation-internals@2.11.1

### Patch Changes

- fix: make composeDirective argument non-nullable.
([#3278](#3278))

Per our
[docs](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/directives#composedirective),
`@composeDirective` requires non-nullable value to be passed as an
argument.

Our
[validations](https://github.com/apollographql/federation/blob/main/composition-js/src/composeDirectiveManager.ts#L250-L255)
were checking for valid values (it has to be a string that starts with
`@`),
but the generated schema was incorrectly specifying that the argument
was nullable.

- Adding new CompositionOption `maxValidationSubgraphPaths`. This value
represents the maximum number of SubgraphPathInfo objects that may exist
in a ValidationTraversal when checking for satisfiability. Setting this
value can help composition error before running out of memory. Default
is 1,000,000.
([#3254](#3254))

## @apollo/query-graphs@2.11.1

### Patch Changes

- Fix bug in composition where, when a field's type in a subgraph is a
subtype of the field's type in the supergraph, the satisfiability
validation spuriously succeeds/errors.
([#3277](#3277))

- Updated dependencies
\[[`7799ad1717becf15fb0e82f89619f2ec8a24b4d4`](7799ad1),
[`b26794c5724ef23d1f0fd45a40aee3d301557489`](b26794c)]:
    -   @apollo/federation-internals@2.11.1

## @apollo/query-planner@2.11.1

### Patch Changes

- Updated dependencies
\[[`7799ad1717becf15fb0e82f89619f2ec8a24b4d4`](7799ad1),
[`b26794c5724ef23d1f0fd45a40aee3d301557489`](b26794c),
[`51bed5be49d8e87adae59f568315c9e3488a91e0`](51bed5b)]:
    -   @apollo/federation-internals@2.11.1
    -   @apollo/query-graphs@2.11.1

## @apollo/subgraph@2.11.1

### Patch Changes

- Updated dependencies
\[[`7799ad1717becf15fb0e82f89619f2ec8a24b4d4`](7799ad1),
[`b26794c5724ef23d1f0fd45a40aee3d301557489`](b26794c)]:
    -   @apollo/federation-internals@2.11.1

## apollo-federation-integration-testsuite@2.11.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants