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

api 1.0 phase 1 #1274

Closed
wants to merge 22 commits into from
Closed

api 1.0 phase 1 #1274

wants to merge 22 commits into from

Conversation

garypen
Copy link
Contributor

@garypen garypen commented Jun 16, 2022

draft PR so that people can see what's coming...

fix: #1146, #1148, #1151, #1141

SimonSapin and others added 21 commits June 10, 2022 14:46
It had become the same as the crate root.
Co-authored-by: bryn <bryn@apollographql.com>
* Modify the async checkpoint signature to reduce boxing.

The current implementation required the provided callback to be boxed.
This change removes that requirement. It requires more generics, but
that is the trade off.
Merge includes Defer enhancements.
Just spotted a redundant Box::pin() which crept back in during the
merge, so removing it.
* Removed ApolloRouterBuilder in favor of buildstructor.

* Entry point improvements

`ApolloRouterBuilder` has been migrated to `buildstructor` for consistency with other code.
Calls to `ApolloRouterBuilder::default()` should be migrated to `ApolloRouter::builder`.
`FederatedServerHandle` has been renamed to `ApolloRouterHandle`.

Removed functionality:
* The ability to supply your own `RouterServiceFactory`. This may be added back if there is a concrete use case for it.
* `StateListener`. This made the internal state machine unnecessarily complex. `ready()` remains on `ApolloRouterHandle`.
* `ApolloRouterHandle#shutdown()` has been removed. Instead dropping `ApolloRouterHandle` will cause the router to shutdown.

Co-authored-by: bryn <bryn@apollographql.com>
Co-authored-by: bryn <bryn@apollographql.com>
Add `Executable::builder`

Co-authored-by: bryn <bryn@apollographql.com>
This is part #1217 but we may want to go further still.

This replaces all occurrences of `pub use some_module::*;` in the root of the `apollo-router` crate with a combination of:

1. Changing users to import from `some_module` instead (sometimes making that module public)
2. `pub use` of some specific items because they make sense there
3. `pub use` or `pub(crate) use` of some specific items because there are very many users and this PR is already too big
4. `pub(crate) use some_module::*;` because there are very many items and users, and this PR is already too big
* add support for modifying request variables from a plugin

Native or rhai.
Make Executable::builder() async

Co-authored-by: bryn <bryn@apollographql.com>
This fixes some of the warnings emitted by `cargo doc`.

Remaining warnings involve either making some types public, or removing mentions of them in public docs and in some cases making fields private. See: #1150 (comment)
I meant this to be part of #1271 and
messed up my commit amend
Some reexports where recently removed, making some items unreachable from other crates as they are defined in private modules. This changes such items from `pub` to `pub(crate)` in order to better communicate the situation to human readers, and enables warnings for the `unreachable_pub` lint.

The diff is mostly generated by `cargo fix` with this lint.
@netlify
Copy link

netlify bot commented Jun 16, 2022

Deploy Preview for apollo-router-docs canceled.

Name Link
🔨 Latest commit 148652d
🔍 Latest deploy log https://app.netlify.com/sites/apollo-router-docs/deploys/62ac50721a70290008e3beae

@Geal
Copy link
Contributor

Geal commented Jun 17, 2022

we should get #1233 in api-1.0 before merging this PR

* move the query cache into the query planner

* move introspection in the query planner

* keep the known introspection queries but remove the mutable introspection cache

we pregenerate introspection responses for known queries, but we will
rely on the caching query planner to store all the actually received
introspection queries

* remove QueryCache

we are now relying on the caching query planner

Co-authored-by: Gary Pennington <gary@apollographql.com>
@garypen
Copy link
Contributor Author

garypen commented Jun 17, 2022

Closing this draft as we are now about to raise the real api-1.0 (phase 1) merge PR

@garypen garypen closed this Jun 17, 2022
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.

API 1.0 - Buildstructor to replace all typedbuilder
4 participants