Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lrlna authored Oct 10, 2023
1 parent c4fc479 commit f3760db
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
32 changes: 24 additions & 8 deletions crates/apollo-compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## Maintenance
## Documentation-->

# [x.x.x] (unreleased) - 2023-mm-dd
# [1.0.0-beta.2](https://crates.io/crates/apollo-compiler/1.0.0-beta.1) - 2023-10-10

## BREAKING

Assorted `Schema` API changes by [SimonSapin] in [pull/678]:
- Type of the `schema_definition` field changed
- Type of the `schema_definition` field changed
from `Option<SchemaDefinition>` to `SchemaDefinition`.
Default root operations based on object type names
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
- 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.
Expand All @@ -39,13 +39,29 @@ Assorted `Schema` API changes by [SimonSapin] in [pull/678]:
used in some Apollo Federation directives in the context of a specific schema and type.
Its `validate` method calls a subset of validation rules relevant to selection sets.
which is not part of a document.
```rust
let input = r#"
type Query {
id: ID
organization: Org
}
type Org {
id: ID
}
"#;
let schema = Schema::parse(input, "schema.graphql");
schema.validate().unwrap();
let input = "id organization { id }";
let field_set = FieldSet::parse(&schema, "Query", input, "field_set.graphql");
field_set.validate(&schema).unwrap();
```

- **Add opt-in configuration for “orphan” extensions to be “adopted” - [SimonSapin], [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.
This behavious is not the default, as it's non-standard.
Configure a schema builder to opt in:
```rust
let input = "extend type Query { x: Int }";
Expand Down Expand Up @@ -78,7 +94,7 @@ Assorted `Schema` API changes by [SimonSapin] in [pull/678]:
Compared to 0.11, version 1.0 is a near-complete rewrite of the library
and revamp of the public API.
While in beta, there may still be breaking changes (though not as dramatic)
until 1.0.0 “final”.
until 1.0.0 “final”.
If using a beta version, we recommend specifying an exact dependency in `Cargo.toml`:

```toml
Expand All @@ -91,8 +107,8 @@ The API is now centered on `Schema` and `ExecutableDocument` types.
Users no longer need to create a compiler, add inputs to it, and track them by ID.
Validation is now a method of these types, and returns a `Result` to indicate errors.

These types are serializable
(through `Display`, `.to_string()`, and a `.serialize()` config builder),
These types are serializable
(through `Display`, `.to_string()`, and a `.serialize()` config builder),
integrating the functionality of the apollo-encoder crate.

They are also mutable, and can be created programmatically out of thin air.
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo-compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-compiler"
version = "1.0.0-beta.1"
version = "1.0.0-beta.2"
authors = ["Irina Shestak <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/apollographql/apollo-rs"
Expand All @@ -18,7 +18,7 @@ edition = "2021"
autotests = false # Most tests/*.rs files are modules of tests/main.rs

[dependencies]
apollo-parser = { path = "../apollo-parser", version = "0.7.0" }
apollo-parser = { path = "../apollo-parser", version = "0.7.1" }
ariadne = { version = "0.3.0", features = ["auto-color"] }
indexmap = "2.0.0"
rowan = "0.15.5"
Expand Down
6 changes: 3 additions & 3 deletions crates/apollo-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

## Features

* A (comparatively) low-level AST for GraphQL grammar,
* A (comparatively) low-level AST for GraphQL grammar,
and high-level representation of `Schema` and `ExecutableDocument`.
* All three can be parsed (using `apollo-parser` internally),
* All three can be parsed (using `apollo-parser` internally),
created or modified programatically,
and serialized.
* Validation of schemas and executable documents, as defined [in the GraphQL specification][val].
Expand All @@ -39,7 +39,7 @@ Or add this to your `Cargo.toml` for a manual installation:
```toml
# Just an example, change to the necessary package version.
[dependencies]
apollo-compiler = "0.11.0"
apollo-compiler = "1.0.0-beta.2"
```

## Rust versions
Expand Down

0 comments on commit f3760db

Please sign in to comment.