Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL cannot parse Account structure from its format string #3462

Open
kikakkz opened this issue Mar 4, 2025 · 0 comments · May be fixed by #3476
Open

GraphQL cannot parse Account structure from its format string #3462

kikakkz opened this issue Mar 4, 2025 · 0 comments · May be fixed by #3476
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kikakkz
Copy link
Contributor

kikakkz commented Mar 4, 2025

Description
When define argument with Account in service.rs, GraphQL cannot parse Account struct from its format string.

Query

let query = format!(                                                                                                                    
      "query {{ balanceOf(owner: \"{}\")}}",                                                                                                                                                                                                                                    
      Account {                                                                                                                           
          chain_id: meme_application_id.creation.chain_id,                                                                                
          owner: Some(AccountOwner::Application(meme_application_id.forget_abi())),                                                       
      },                                                                                                                                  
  );                                                                                                                                      
  let QueryOutcome { response, .. } = meme_chain.graphql_query(meme_application_id, query).await;                                         
  assert_eq!(                                                                                                                             
      Amount::from_str(response["balanceOf"].as_str().unwrap()).unwrap(),                                                                 
      initial_supply.try_sub(initial_liquidity).unwrap(),                                                                                 
  );

Error

Failed to parse \"Account\": invalid type: string \"59ac87e09448b72d4b910ecc20855a6292d9f29c32a7894e592f8a7d1b51cb11:Application:2e5649769255ce2eeb353c1b1962edec449fb19f00c7a283f2f7db68ea782dc1012e2b736ebef10e98b41ed5cde4bab0fb91a12950a7772f426137d80c2e533359ac87e09448b72d4b910ecc20855a6292d9f29c32a7894e592f8a7d1b51cb11040000000000000000000000\", expected struct Account
@ma2bd ma2bd added the bug Something isn't working label Mar 4, 2025
@ma2bd ma2bd added this to Web3 SDK Mar 4, 2025
@ma2bd ma2bd added this to the Testnet #2 milestone Mar 4, 2025
@jvff jvff linked a pull request Mar 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants