Skip to content

Commit

Permalink
Derive Eq, PartialEq for SupergraphConfig and SubgraphConfig (#514)
Browse files Browse the repository at this point in the history
Helps in solving for apollographql/rover#480

In order to use `SupergraphConfig` as child element of
[RoverOutput](https://github.com/apollographql/rover/blob/main/src/command/output.rs#L42)
to produce yaml or json, we would need these types to be `Eq +
PartialEq`.
  • Loading branch information
dotdat authored Jun 21, 2024
2 parents 036dff9 + e8849b2 commit c213606
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apollo-federation-types/src/config/subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use url::Url;

/// Config for a single [subgraph](https://www.apollographql.com/docs/federation/subgraphs/)
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct SubgraphConfig {
/// The routing URL for the subgraph.
/// This will appear in supergraph SDL and
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation-types/src/config/supergraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{collections::BTreeMap, fs};

/// The configuration for a single supergraph
/// composed of multiple subgraphs.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct SupergraphConfig {
// Store config in a BTreeMap, as HashMap is non-deterministic.
subgraphs: BTreeMap<String, SubgraphConfig>,
Expand Down

0 comments on commit c213606

Please sign in to comment.