Questions tagged [async-graphql]
10 questions
4
votes
0 answers
How to get original GraphQL query from AWS AppSync request
Introduction
Currently, we're using AWS AppSync as API entry point for our proper GraphQL API.
The point is that we need to retrieve the original GraphQL query from the request AppSync sends to our GraphQL API.
In brief we have:
Client --[original…

Mpu-Mypl
- 41
- 3
3
votes
1 answer
How can I instrument async-graphql functions with tracing?
Copying the starwars example for actix-web I'm having issues understanding these errors when trying to instrument:
#[derive(Debug)] // adding this
struct AppState {
gql_schema: Schema, // errors here…

Fred Hors
- 3,258
- 3
- 25
- 71
2
votes
0 answers
Is tracing intended to be used as I am using it? How can I trace errors chain?
I'm using async-graphql and axum.
This is a reproduction of the issue: https://github.com/frederikhors/iss-async-graphql-error-handling.
To start:
cargo run
If you open the GraphiQL client at http://localhost:8000, you can use the below query to…

Fred Hors
- 3,258
- 3
- 25
- 71
2
votes
1 answer
How to fix the error "the trait `OutputType` is not implemented for `time::OffsetDateTime`"?
I'm using async-graphql and I'm trying to use this struct as SimpleObject:
use async_graphql::{CSimpleObject};
#[derive(SimpleObject)]
struct Player {
id: String,
created_at: time::OffsetDateTime,
email: String,
}
but I'm getting this…

Fred Hors
- 3,258
- 3
- 25
- 71
1
vote
0 answers
the trait `async_graphql::OutputType` is not implemented for `entity::user::Model`
i'm trying to return user model in my graphql mutation after it, when i'm making ->ResultUser::Model rust giving an error that the trait 'async_graphql::OutputType' is not implemented for 'entity::user::Model',
i was checking few examples (seaorm…

M1nybe
- 37
- 4
1
vote
0 answers
How do I insert the Context type from GraphQL into a Rust test?
Anyone worked with the async graphql crate here?
I have a create_book function as part of my MutationResolver that receives the graphql async Context type in order to pull out the Datastore struct.
use async_graphql::{Context, Object, Result,…

Mike Chan
- 167
- 1
- 11
1
vote
2 answers
How to share state between async-graphql and axum
I'm now trying to build a graphql server using axum and async-graphql.
The biggest problem is that data sharing between graphql and axum is not good.
The reason why I want to do this is because I want to pass the http header for authentication…

kjt
- 11
- 2
0
votes
0 answers
Rust Async Graphql Json InputObject Type
I'm trying to use Async Graphql, I want to use sqlx json type in model. In normal api operations the code is running. But when I want to use the async graphql InputObject macro, I get an error. The codes I used are as follows, I couldn't find a…

Saadettin Yasir AKEL
- 71
- 1
- 8
0
votes
0 answers
How to avoid cyclical addiction in this situation?
I have many lib crates and only one bin crate.
In the lib crates I have this simple code (different for each one):
use async_graphql::{Context, Object, Result};
use app::Services;
use std::sync::Arc;
#[derive(Default)]
pub struct…

Fred Hors
- 3,258
- 3
- 25
- 71
0
votes
0 answers
The trait bound `ObjectType` is not satisfied, why? This code is from docs
Using async-graphql and the below code (from their docs):
use async_graphql::{
extensions::Tracing, EmptyMutation, EmptySubscription, MergedObject, Object, Schema,
};
pub type GraphqlSchema = Schema

Fred Hors
- 3,258
- 3
- 25
- 71