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

adopt_orphan_extensions opt in flag + allow extending implicit schema #678

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
38 changes: 37 additions & 1 deletion crates/apollo-compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,48 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

# [x.x.x] (unreleased) - 2023-mm-dd

## BREAKING

Assorted `Schema` API changes by [SimonSapin] in [pull/678]:
- Type of the `schema_definition` field changed
from `Option<SchemaDefinition>` to `SchemaDefinition`.
Default root operations based on object type names
are now stored explicitly in `SchemaDefinition`.
Serialization relies on a heuristic to decide on implicit schema definition.
- Removed `schema_definition_directives` method: no longer having an `Option` allows
field `schema.schema_definition.directives` to be accessed directly
- Removed `query_root_operation`, `mutation_root_operation`, and `subscription_root_operation`
methods. Instead `schema.schema_definition.query` etc can be accessed directly.

## Features

- Add opt-in configuration for “orphan” extensions to be “adopted”, by [SimonSapin] in [pull/678]

Type extensions and schema extensions without a corresponding definition
are normally ignored except for recording a validation error.
In this new mode, an implicit empty definition to extend is generated instead.
Because this behavior is non-standard it is not the default.
Configure a schema builder to opt in:
```rust
let input = "extend type Query { x: Int }";
let schema = apollo_compiler::Schema::builder()
.adopt_orphan_extensions()
.parse(input, "schema.graphql")
.build();
schema.validate()?;
```


## Fixes

- Allow built-in directives to be redefined, by [SimonSapin] in [pull/684], [issue/656]
- Allow schema extensions to extend a schema definition implied by object types named after default root operations, by [SimonSapin] in [pull/678], [issues/682]

[pull/684]: https://github.com/apollographql/apollo-rs/pull/684
[SimonSapin]: https://github.com/SimonSapin
[issue/656]: https://github.com/apollographql/apollo-rs/issues/656
[issue/682]: https://github.com/apollographql/apollo-rs/issues/682
[pull/678]: https://github.com/apollographql/apollo-rs/pull/678
[pull/684]: https://github.com/apollographql/apollo-rs/pull/684

# [1.0.0-beta.1](https://crates.io/crates/apollo-compiler/1.0.0-beta.1) - 2023-10-05

Expand Down
Loading