Skip to content

refactor: reverse dependency between graphql-client and transaction-builder#530

Open
DaughterOfMars wants to merge 19 commits intodevelopfrom
refactor/reverse-graphql-transaction-builder-dependency
Open

refactor: reverse dependency between graphql-client and transaction-builder#530
DaughterOfMars wants to merge 19 commits intodevelopfrom
refactor/reverse-graphql-transaction-builder-dependency

Conversation

@DaughterOfMars
Copy link
Copy Markdown
Contributor

@DaughterOfMars DaughterOfMars commented Jan 26, 2026

Summary

This PR reverses the dependency relationship between iota-sdk-graphql-client and iota-sdk-transaction-builder crates.

Changes

Code Migration

  • Moved ClientMethods implementation for GraphQL Client from transaction-builder to graphql-client crate
  • Moved WaitForTx enum definition to transaction-builder crate (re-exported from graphql-client)
  • Moved integration tests that require a live GraphQL server to graphql-client crate

Test Utilities

  • Added TestClient stub implementation in transaction-builder for use in doc tests
  • TestClient is gated behind the test-client feature and provides stub implementations of ClientMethods
  • Updated doc examples to use TestClient with no_run attributes

Benefits

  • The transaction-builder crate is now more standalone and can be used without pulling in GraphQL dependencies
  • Better separation of concerns: the trait definition (ClientMethods) lives in transaction-builder, while the concrete implementation for GraphQL lives in graphql-client
  • Enables future alternative client implementations without modifying transaction-builder

Testing

  • cargo check --workspace passes
  • cargo nextest run --all-features --workspace --exclude iota-sdk-graphql-client passes

…uilder

- Move ClientMethods implementation for GraphQL Client from transaction-builder to graphql-client crate
- graphql-client now depends on transaction-builder (previously the opposite)
- Move WaitForTx enum to transaction-builder crate
- Add TestClient stub implementation for use in tests
- Update doc examples to use TestClient with no_run/ignore attributes
- Move integration tests to graphql-client crate

This change makes the transaction-builder crate more standalone and allows
it to be used without the graphql-client dependency.
@DaughterOfMars DaughterOfMars requested a review from a team as a code owner January 26, 2026 11:52
}

#[tokio::test]
async fn test_transfer_obj_execution() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels very weird moving the TxBuilder tests in the client crate tbh. I don't think we would have a cycle if we import the client only in the dev-deps

Comment thread crates/integration-tests/src/lib.rs
Comment thread crates/integration-tests/test_example_v1/Move.lock Outdated
Copy link
Copy Markdown
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will review when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants