Skip to content

Commit 8b62713

Browse files
committed
Atlassian: Use name instead of id for mock file
1 parent 6ec1fbb commit 8b62713

File tree

1 file changed

+5
-1
lines changed
  • compiler/crates/persisted-mocks/src

1 file changed

+5
-1
lines changed

compiler/crates/persisted-mocks/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use schema::SDLSchema;
1515
#[derive(serde::Serialize)]
1616
struct QueryForMock {
1717
signature: &'static str,
18+
id: String,
1819
operation: String,
1920
}
2021

@@ -30,12 +31,15 @@ pub fn generate_persisted_mocks(
3031
if let ArtifactContent::Operation {
3132
text: Some(text),
3233
id_and_text_hash: Some(QueryID::Persisted { id, .. }),
34+
normalization_operation,
3335
..
3436
} = &artifact.content
3537
{
36-
let full_path = folder.join(format!("{id}.json"));
38+
let name = normalization_operation.name.item;
39+
let full_path = folder.join(format!("{name}.json"));
3740
let query = QueryForMock {
3841
signature: signedsource::SIGNING_TOKEN,
42+
id: id.clone(),
3943
operation: text.clone(),
4044
};
4145
let str = serde_json::to_string_pretty(&query).unwrap();

0 commit comments

Comments
 (0)