-
Notifications
You must be signed in to change notification settings - Fork 257
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
Prep 2.10.0 preview.1 #3179
Prep 2.10.0 preview.1 #3179
Conversation
Adds validations to subgraph directive applications, per the specification in https://ibm.github.io/graphql-specs/cost-spec.html#sec-Validation. These rules primarily assert that the @cost and @listsize directive arguments reference valid fields of the correct type for each application. <!-- ROUTER-741 -->
Update Uplink description
…ter names (#3155) Subgraph number set for a contextual paramter was colliding if used in multiple subgraphs
Better handling of wrapped types in list size validations
Fixes handling of a `__typename` selection during query planning process. When expanding fragments we were keeping references to the same `Field`s regardless where those fragments appeared in our original selection set. This was generally fine as in most cases we would have same inline fragment selection sets across whole operation but was causing problems when we were applying another optimization by collapsing those expanded inline fragments creating a new selection set. As a result, if any single field selection (within that fragment) would perform optimization around the usage of `__typename`, ALL occurrences of that field selection would get that optimization as well. See example below ```graphql foo { f1 { ... on Bar { __typename ...onBar # will be collapsed and sub selections will optimize __typename } } f2 { ...onBar # sub selections will get __typename optimization from above } } fragment onBar on Bar { b c } ``` --------- Co-authored-by: Sachin D. Shinde <[email protected]>
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/[email protected] ### Patch Changes - Updated dependencies \[[`2192f355f50db33fe0807d16153f357696b9f190`](2192f35), [`e1e2605b30efc488b57f62ba43436606a38a3607`](e1e2605), [`5ac01b534318105e904c1e6598070f753add3bb1`](5ac01b5)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`2192f355f50db33fe0807d16153f357696b9f190`](2192f35), [`e1e2605b30efc488b57f62ba43436606a38a3607`](e1e2605), [`5ac01b534318105e904c1e6598070f753add3bb1`](5ac01b5)]: - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Fixes handling of a `__typename` selection during query planning process. ([#3156](#3156)) When expanding fragments we were keeping references to the same `Field`s regardless where those fragments appeared in our original selection set. This was generally fine as in most cases we would have same inline fragment selection sets across whole operation but was causing problems when we were applying another optimization by collapsing those expanded inline fragments creating a new selection set. As a result, if any single field selection (within that fragment) would perform optimization around the usage of `__typename`, ALL occurrences of that field selection would get that optimization as well. - Add validations for demand control directive applications ([#3148](#3148)) ## @apollo/[email protected] ### Patch Changes - Fixes issue where contextual parameters can have naming collisions if used in multiple subgraphs ([#3155](#3155)) - Updated dependencies \[[`2192f355f50db33fe0807d16153f357696b9f190`](2192f35), [`5ac01b534318105e904c1e6598070f753add3bb1`](5ac01b5)]: - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Fixes handling of a `__typename` selection during query planning process. ([#3156](#3156)) When expanding fragments we were keeping references to the same `Field`s regardless where those fragments appeared in our original selection set. This was generally fine as in most cases we would have same inline fragment selection sets across whole operation but was causing problems when we were applying another optimization by collapsing those expanded inline fragments creating a new selection set. As a result, if any single field selection (within that fragment) would perform optimization around the usage of `__typename`, ALL occurrences of that field selection would get that optimization as well. - Fixes issue where contextual parameters can have naming collisions if used in multiple subgraphs ([#3155](#3155)) - Updated dependencies \[[`2192f355f50db33fe0807d16153f357696b9f190`](2192f35), [`e1e2605b30efc488b57f62ba43436606a38a3607`](e1e2605), [`5ac01b534318105e904c1e6598070f753add3bb1`](5ac01b5)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`2192f355f50db33fe0807d16153f357696b9f190`](2192f35), [`5ac01b534318105e904c1e6598070f753add3bb1`](5ac01b5)]: - @apollo/[email protected] ## [email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
When generating fragments we were only "minimizing" subselections for fields and inline fragments that could be extracted. If inline fragment cannot be replaced with a fragment spread, we should still minimize its selection set as it potentially can be optimized as well.
`FieldSet` scalar represents a selection set without outer braces. This means that users could potentially specify some selections that could be normalized (i.e. eliminate duplicate field selections, hoist/collapse unnecessary inline fragments, etc). Previously we were using `@requires` field set selection AS-IS for edge conditions. With this change we will now normalize the `FieldSet` selections before using them as fetch node conditions. <!-- FED-390 -->
When removing "useless" fetch nodes/groups we remove them in-place while still iterating over the same list. This leads to potentially skipping processing of some the children fetch nodes, as when we remove nodes we left shift all remaining children but the iterator keeps the old position unchanged effectively skipping next child. <!-- FED-386 --->
…equires (#3165) Normalization for conditions/field sets makes sense for recursive query planning, but we can't quite do it for `@provides` (inline fragments have a specific meaning there) and `@fromContext` (we'd like to forbid non-top-level inline fragments there), and some composition validations become more complex to explain/spot if we permit them to normalize. This PR restricts that normalization to when we fetch the conditions for `@key`/`@requires` field sets.
…ly check for a direct `@key` edge (#3160) This PR fixes a bug where when removing suboptimal indirect paths, we didn't properly check for a direct `@key` edge at the end of the potential direct path. <!-- ROUTER-750 -->
### Problem The sibling typename optimization treated `__typename` and `__typename @Skip(if:$X)` interchangeably. Thus, one could become a sibling of the other, depending on the order they appear in query. That is problematic, since sibling typename should not have directives or aliases. Also, there was another bug in `selectionsInPrintOrder` function where some __typename selections with directives could be dropped unexpectedly if there are multiple __typename selections in the same selection set. ### Fix Summary - fixed sibling typename optimization to only fold plain __typename without alias/directives. - fixed `selectionsInPrintOrder` to not drop duplicate __typename selections with directives.
…leUsages` field (#3166) Fixed missing referenced variables in the `variableUsages` field of fetch operations Query variables used in fetch operation should be listed in the `variableUsages` field. However, there was a bug where variables referenced by query-level directives could be missing in the field. The previous PR (#2986) fixed a similar issue in fetch queries, but it didn't fully fix the issue by failing to update the `variableUsages` field. This PR completes the remaining issue. <!-- [FED-387] --> [FED-387]: https://apollographql.atlassian.net/browse/FED-387?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Fixes edge case where contextual arguments can lead to inefficient query plans. Also fixes naming of query plan arguments which can be a problem when using contextual variables in multiple subraphs. --------- Co-authored-by: Sachin D. Shinde <[email protected]>
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/[email protected] ### Patch Changes - Updated dependencies \[[`345661c558773e4eb5d5f0b28464a8d1acdc2a2d`](345661c), [`e00e1c9892b48ac89823597113989830877966ef`](e00e1c9), [`cc4573471696ef78d04fa00c4cf8e5c50314ba9f`](cc45734), [`062572b3253e8640b60a0bf58b83945094b76b6f`](062572b), [`df5eb3cb0e2b4802fcd425ab9c23714de2707db3`](df5eb3c), [`1c99cb0dcc6c639ac351210932623ab0bd6907e4`](1c99cb0)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`345661c558773e4eb5d5f0b28464a8d1acdc2a2d`](345661c), [`7fe1465cf35c2efe37ac5c73fac2b7ea04173318`](7fe1465), [`cc4573471696ef78d04fa00c4cf8e5c50314ba9f`](cc45734), [`062572b3253e8640b60a0bf58b83945094b76b6f`](062572b), [`df5eb3cb0e2b4802fcd425ab9c23714de2707db3`](df5eb3c), [`1c99cb0dcc6c639ac351210932623ab0bd6907e4`](1c99cb0)]: - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - fix: normalize field set selection sets ([#3162](#3162)) `FieldSet` scalar represents a selection set without outer braces. This means that users could potentially specify some selections that could be normalized (i.e. eliminate duplicate field selections, hoist/collapse unnecessary inline fragments, etc). Previously we were using `@requires` field set selection AS-IS for edge conditions. With this change we will now normalize the `FieldSet` selections before using them as fetch node conditions. - Fixed missing referenced variables in the `variableUsages` field of fetch operations ([#3166](#3166)) Query variables used in fetch operation should be listed in the `variableUsages` field. However, there was a bug where variables referenced by query-level directives could be missing in the field. - Fix fragment generation recursion logic to apply minification on all subselections. ([#3158](#3158)) - Fixed a bug that `__typename` with applied directives gets lost in fetch operations. ([#3164](#3164)) The sibling typename optimization used by query planner simplifies operations by folding `__typename` selections into their sibling selections. However, that optimization does not account for directives or aliases. The bug was applying the optimization even if the `__typename` has directives on it, which caused the selection to lose its directives. Now, `__typename` with directives (or aliases) are excluded from the optimization. ## @apollo/[email protected] ### Patch Changes - Fixes edge case where contextual arguments can yield inefficient query plans. Also fixes naming of query plan arguments which can be a problem when using contextual variables in multiple subgraphs ([#3140](#3140)) - When eliminating suboptimal indirect paths during query planning, properly check for a direct `@key` edge at the end of the potential direct path. ([#3160](#3160)) - Fixed missing referenced variables in the `variableUsages` field of fetch operations ([#3166](#3166)) Query variables used in fetch operation should be listed in the `variableUsages` field. However, there was a bug where variables referenced by query-level directives could be missing in the field. - Updated dependencies \[[`cc4573471696ef78d04fa00c4cf8e5c50314ba9f`](cc45734), [`062572b3253e8640b60a0bf58b83945094b76b6f`](062572b), [`df5eb3cb0e2b4802fcd425ab9c23714de2707db3`](df5eb3c), [`1c99cb0dcc6c639ac351210932623ab0bd6907e4`](1c99cb0)]: - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Fixes edge case where contextual arguments can yield inefficient query plans. Also fixes naming of query plan arguments which can be a problem when using contextual variables in multiple subgraphs ([#3140](#3140)) - Ensure all useless fetch groups are removed ([#3163](#3163)) When removing "useless" fetch nodes/groups we remove them in-place while still iterating over the same list. This leads to potentially skipping processing of some the children fetch nodes, as when we remove nodes we left shift all remaining children but the iterator keeps the old position unchanged effectively skipping next child. - fix: normalize field set selection sets ([#3162](#3162)) `FieldSet` scalar represents a selection set without outer braces. This means that users could potentially specify some selections that could be normalized (i.e. eliminate duplicate field selections, hoist/collapse unnecessary inline fragments, etc). Previously we were using `@requires` field set selection AS-IS for edge conditions. With this change we will now normalize the `FieldSet` selections before using them as fetch node conditions. - Fixed missing referenced variables in the `variableUsages` field of fetch operations ([#3166](#3166)) Query variables used in fetch operation should be listed in the `variableUsages` field. However, there was a bug where variables referenced by query-level directives could be missing in the field. - Fixed a bug that `__typename` with applied directives gets lost in fetch operations. ([#3164](#3164)) The sibling typename optimization used by query planner simplifies operations by folding `__typename` selections into their sibling selections. However, that optimization does not account for directives or aliases. The bug was applying the optimization even if the `__typename` has directives on it, which caused the selection to lose its directives. Now, `__typename` with directives (or aliases) are excluded from the optimization. - Updated dependencies \[[`345661c558773e4eb5d5f0b28464a8d1acdc2a2d`](345661c), [`e00e1c9892b48ac89823597113989830877966ef`](e00e1c9), [`cc4573471696ef78d04fa00c4cf8e5c50314ba9f`](cc45734), [`062572b3253e8640b60a0bf58b83945094b76b6f`](062572b), [`df5eb3cb0e2b4802fcd425ab9c23714de2707db3`](df5eb3c), [`1c99cb0dcc6c639ac351210932623ab0bd6907e4`](1c99cb0)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`cc4573471696ef78d04fa00c4cf8e5c50314ba9f`](cc45734), [`062572b3253e8640b60a0bf58b83945094b76b6f`](062572b), [`df5eb3cb0e2b4802fcd425ab9c23714de2707db3`](df5eb3c), [`1c99cb0dcc6c639ac351210932623ab0bd6907e4`](1c99cb0)]: - @apollo/[email protected] ## [email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Merge docs content of new docs site <!-- First, 🌠 thank you 🌠 for taking the time to consider a contribution to Apollo! Here are some important details to follow: * ⏰ Your time is important To save your precious time, if the contribution you are making will take more than an hour, please make sure it has been discussed in an issue first. This is especially true for feature requests! * 💡 Features Feature requests can be created and discussed within a GitHub Issue. Be sure to search for existing feature requests (and related issues!) prior to opening a new request. If an existing issue covers the need, please upvote that issue by using the 👍 emote, rather than opening a new issue. * 🕷 Bug fixes These can be created and discussed in this repository. When fixing a bug, please _try_ to add a test which verifies the fix. If you cannot, you should still submit the PR but we may still ask you (and help you!) to create a test. * Federation versions Please make sure you're targeting the federation version you're opening the PR for. Federation 2 (alpha) is currently located on the `main` branch and prior versions of Federation live on the `version-0.x` branch. * 📖 Contribution guidelines Follow https://github.com/apollographql/federation/blob/HEAD/CONTRIBUTING.md when submitting a pull request. Make sure existing tests still pass, and add tests for all new behavior. * ✏️ Explain your pull request Describe the big picture of your changes here to communicate to what your pull request is meant to accomplish. Provide 🔗 links 🔗 to associated issues! We hope you will find this to be a positive experience! Open source contribution can be intimidating and we hope to alleviate that pain as much as possible. Without following these guidelines, you may be missing context that can help you succeed with your contribution, which is why we encourage discussion first. Ultimately, there is no guarantee that we will be able to merge your pull-request, but by following these guidelines we can try to avoid disappointment. --> --------- Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
these errors are technically in fed 2.7 but were removed for 2.9 and beyond. we never formally documented the directives that would trigger them so they can be removed. <!-- First, 🌠 thank you 🌠 for taking the time to consider a contribution to Apollo! Here are some important details to follow: * ⏰ Your time is important To save your precious time, if the contribution you are making will take more than an hour, please make sure it has been discussed in an issue first. This is especially true for feature requests! * 💡 Features Feature requests can be created and discussed within a GitHub Issue. Be sure to search for existing feature requests (and related issues!) prior to opening a new request. If an existing issue covers the need, please upvote that issue by using the 👍 emote, rather than opening a new issue. * 🕷 Bug fixes These can be created and discussed in this repository. When fixing a bug, please _try_ to add a test which verifies the fix. If you cannot, you should still submit the PR but we may still ask you (and help you!) to create a test. * Federation versions Please make sure you're targeting the federation version you're opening the PR for. Federation 2 (alpha) is currently located on the `main` branch and prior versions of Federation live on the `version-0.x` branch. * 📖 Contribution guidelines Follow https://github.com/apollographql/federation/blob/HEAD/CONTRIBUTING.md when submitting a pull request. Make sure existing tests still pass, and add tests for all new behavior. * ✏️ Explain your pull request Describe the big picture of your changes here to communicate to what your pull request is meant to accomplish. Provide 🔗 links 🔗 to associated issues! We hope you will find this to be a positive experience! Open source contribution can be intimidating and we hope to alleviate that pain as much as possible. Without following these guidelines, you may be missing context that can help you succeed with your contribution, which is why we encourage discussion first. Ultimately, there is no guarantee that we will be able to merge your pull-request, but by following these guidelines we can try to avoid disappointment. -->
Fix spacing and line breaks for Fed versions page <!-- First, 🌠 thank you 🌠 for taking the time to consider a contribution to Apollo! Here are some important details to follow: * ⏰ Your time is important To save your precious time, if the contribution you are making will take more than an hour, please make sure it has been discussed in an issue first. This is especially true for feature requests! * 💡 Features Feature requests can be created and discussed within a GitHub Issue. Be sure to search for existing feature requests (and related issues!) prior to opening a new request. If an existing issue covers the need, please upvote that issue by using the 👍 emote, rather than opening a new issue. * 🕷 Bug fixes These can be created and discussed in this repository. When fixing a bug, please _try_ to add a test which verifies the fix. If you cannot, you should still submit the PR but we may still ask you (and help you!) to create a test. * Federation versions Please make sure you're targeting the federation version you're opening the PR for. Federation 2 (alpha) is currently located on the `main` branch and prior versions of Federation live on the `version-0.x` branch. * 📖 Contribution guidelines Follow https://github.com/apollographql/federation/blob/HEAD/CONTRIBUTING.md when submitting a pull request. Make sure existing tests still pass, and add tests for all new behavior. * ✏️ Explain your pull request Describe the big picture of your changes here to communicate to what your pull request is meant to accomplish. Provide 🔗 links 🔗 to associated issues! We hope you will find this to be a positive experience! Open source contribution can be intimidating and we hope to alleviate that pain as much as possible. Without following these guidelines, you may be missing context that can help you succeed with your contribution, which is why we encourage discussion first. Ultimately, there is no guarantee that we will be able to merge your pull-request, but by following these guidelines we can try to avoid disappointment. -->
<!-- First, 🌠 thank you 🌠 for taking the time to consider a contribution to Apollo! Here are some important details to follow: * ⏰ Your time is important To save your precious time, if the contribution you are making will take more than an hour, please make sure it has been discussed in an issue first. This is especially true for feature requests! * 💡 Features Feature requests can be created and discussed within a GitHub Issue. Be sure to search for existing feature requests (and related issues!) prior to opening a new request. If an existing issue covers the need, please upvote that issue by using the 👍 emote, rather than opening a new issue. * 🕷 Bug fixes These can be created and discussed in this repository. When fixing a bug, please _try_ to add a test which verifies the fix. If you cannot, you should still submit the PR but we may still ask you (and help you!) to create a test. * Federation versions Please make sure you're targeting the federation version you're opening the PR for. Federation 2 (alpha) is currently located on the `main` branch and prior versions of Federation live on the `version-0.x` branch. * 📖 Contribution guidelines Follow https://github.com/apollographql/federation/blob/HEAD/CONTRIBUTING.md when submitting a pull request. Make sure existing tests still pass, and add tests for all new behavior. * ✏️ Explain your pull request Describe the big picture of your changes here to communicate to what your pull request is meant to accomplish. Provide 🔗 links 🔗 to associated issues! We hope you will find this to be a positive experience! Open source contribution can be intimidating and we hope to alleviate that pain as much as possible. Without following these guidelines, you may be missing context that can help you succeed with your contribution, which is why we encourage discussion first. Ultimately, there is no guarantee that we will be able to merge your pull-request, but by following these guidelines we can try to avoid disappointment. -->
Update links
This PR attempts to corrects the API documentation link to the new location, which I believe is: https://www.apollographql.com/docs/apollo-server/using-federation/api/apollo-gateway. Currently the existing link 404's. --------- Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
✅ Docs Preview ReadyNo new or changed pages found. |
🦋 Changeset detectedLatest commit: a0359b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
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. |
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 next, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `next` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `next`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`a0359b0c9a2d9890e1e200d5dc530a1ca4e1d647`](a0359b0)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`a0359b0c9a2d9890e1e200d5dc530a1ca4e1d647`](a0359b0)]: - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Incorporate changes from v2.9.3 ([#3179](#3179)) ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`a0359b0c9a2d9890e1e200d5dc530a1ca4e1d647`](a0359b0)]: - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`a0359b0c9a2d9890e1e200d5dc530a1ca4e1d647`](a0359b0)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Patch Changes - Updated dependencies \[[`a0359b0c9a2d9890e1e200d5dc530a1ca4e1d647`](a0359b0)]: - @apollo/[email protected] ## [email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No description provided.