apollographql / apollo-rs

Spec compliant GraphQL Tools in Rust.
Apache License 2.0
576 stars 45 forks source link

Add `Valid::assume_valid_ref` #768

Closed SimonSapin closed 11 months ago

SimonSapin commented 11 months ago

federation-next needs this to upgrade to beta 8+

SimonSapin commented 11 months ago

The FederationSchema struct owns a Schema and some methods mutate it. This PR enables converting to &Valid<Schema> (for use in FieldSet::parse) from &Valid<FederationSchema> which also has the non-mutating methods.

Before this PR, ValidFederationSchema would have to be an entirely separate type that owns Valid<Schema> and duplicates non-mutating methods.

goto-bus-stop commented 11 months ago

Ahhh right I get it, thanks!