Skip to content

Commit

Permalink
refactor(term): move generated gql client code to generated dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Jun 13, 2024
1 parent a46f99f commit 8600f55
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions crates/synd_term/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ use self::query::subscription::SubscriptionOutput;

mod scalar;
pub use scalar::*;
#[path = "generated/mutation.rs"]
pub mod mutation;
pub mod payload;
#[path = "generated/query.rs"]
pub mod query;

#[derive(Error, Debug)]
Expand Down
8 changes: 6 additions & 2 deletions crates/synd_term/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ mod test {
}

{
// Unsubscribe popup
tx.send(key!('d'));
// Prompt unsubscribe popup and move selection
tx.send_multi([key!('d'), key!('l'), key!('h')]);
application
.wait_until_jobs_completed(&mut event_stream)
.await;
Expand Down Expand Up @@ -286,6 +286,8 @@ mod test {
},{
insta::assert_debug_snapshot!("filter_entries_initial_fetch", application.buffer());
});
// Cover move
tx.send_multi([key!('j'), key!('g'), key!('e'), key!('g'), key!('g')]);
}

// Move Feed tab
Expand All @@ -299,6 +301,8 @@ mod test {
},{
insta::assert_debug_snapshot!("filter_entries_initial_fetch_feed", application.buffer());
});
// Cover move_last and move_first
tx.send_multi([key!('g'), key!('e'), key!('g'), key!('g')]);
// Move back
tx.send(key!(tab));
}
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
# not supported yet in crane
# cargoLlvmCovCommand = "nextest";
cargoLlvmCovExtraArgs =
"--codecov --all-features --output-path $out";
"--codecov --all-features --output-path $out --ignore-filename-regex '(client/generated/*.rs)'";
});

synd-term-image = syndTermImage;
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ review:
coverage *flags:
nix run nixpkgs#cargo-llvm-cov -- llvm-cov nextest \
--all-features --open \
--ignore-filename-regex integration_backend.rs \
--ignore-filename-regex '(integration_backend.rs|client/generated/.*.rs)' \
{{ flags }}

# Update synd_api graphql schema
Expand All @@ -81,15 +81,15 @@ update-gql-schema:
gen-gql:
graphql-client generate \
--schema-path crates/synd_term/gql/schema.json \
--output-directory crates/synd_term/src/client \
--output-directory crates/synd_term/src/client/generated \
--variables-derives "Debug,Clone,PartialEq,Eq" \
--response-derives "Debug,Clone,PartialEq,Eq" \
--custom-scalars-module "crate::client::scalar" \
crates/synd_term/gql/query.gql

graphql-client generate \
--schema-path crates/synd_term/gql/schema.json \
--output-directory crates/synd_term/src/client \
--output-directory crates/synd_term/src/client/generated \
--variables-derives "Debug,Clone,PartialEq,Eq" \
--response-derives "Debug,Clone,PartialEq,Eq" \
--custom-scalars-module "crate::client::scalar" \
Expand Down

0 comments on commit 8600f55

Please # to comment.