0

I am trying to use Rust aws-sdk to consume graphQL endpoint hosted on Appsync. I am looking for query, mutation as well as subscription.

Is it possible to establish the connection with Appsync server using rust amplify sdk?

Following is the react code I am trying to mimic in Rust.

React code
import { Amplify, API, graphqlOperation } from 'aws-amplify';
import { getHealth } from './graphql/queries';
import awsconfig from './aws-exports';

Amplify.configure(awsconfig);
function App() {
  (async () => {
    const res = await API.graphql(graphqlOperation(getHealth));
  })();
Rust code
use aws_sdk_amplify as amplify;

#[tokio::main]
async fn main() -> Result<(), amplify::Error> {
    let config = aws_config::load_from_env().await;
    let client = amplify::Client::new(&config);

    client. ?

    Ok(())
}
p_b
  • 11
  • 1
  • 7

0 Answers0