Tag: rust
-
How to load rust struct vector data into GraphQL for query usage? OutputType error
0 After successfully creating a sample Rust+GraphQL project using async-graphql and axum and visualizing something in the playground, the time has come to actually use data for queries. I am using this for schema: let schema = Schema::build( Query, EmptyMutation, EmptySubscription ) .data(user_data) .finish(); where Query is: pub(crate) struct Query; where user_data is: pub struct…
-
prevent a trait function from being implemented by other struct
9 I just build a trait Bar with 2 functions (alpha() with implementation and beta() with only interfaces), and I hope the struct who implement Bar implements only beta(), and never implement their own alpha(). Is there any way to prevent another struct from implementing their own alpha()? trait Bar { fn alpha(&self) { println!("you…
-
Rust Developer – IT Convergence – Sunnyvale, CA
IT Convergence Sunnyvale, CA Depends on Experience Contract: Independent, W2, 12 Month(s) Skills Rust GQL GraphQL Job Description Seeking a RUST Developer for a long-term contract with aa leading global retail chain corporation in the United States. This is hybrid role in Sunnyvale, CA. Please review the job description below and let me know if…
-
SW Engineer (Rust Developer) – Flexton Inc – Sunnyvale, CA
Flexton Inc Sunnyvale, CA $55 – $60 Contract: W2, Independent, 12 Month(s) Skills Rust GraphQl Graph QL GQL Job Description Greetings! Hope you are doing well. Please let me know if you are available for the below mentioned position or if you can refer any of your contacts. Role- SW Engineer (Rust Developer) Location…
-
Is there anyway to store related 1-m entities in sea orm for quering with graphql?
0 so, for example i have user entity which has related adverts (one user -> many adverts) use async_graphql::{self, SimpleObject}; use chrono::NaiveDateTime; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, SimpleObject)] #[sea_orm(table_name = "user")] #[graphql(name = "User")] pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub name: String, pub surname: String,…
-
Using Actix Identity with Juniper GraphQL
1 I use Actix Identity with Cookie Policy to store user session and about to migrate from REST to GraphQL using Juniper. It would be great to create a login endpoint in GraphQL by using actix identity. Using Juniper in Actix, I’ve to move GraphQL request into web::block actix_web::web::block(|| move { let graphql_response = request.execute(&data,…
-
Rust Async Graphql Json InputObject Type
0 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 solution for the problem. #[derive(Serialize,…
-
How can I set the name of fields in my schema using Juniper and Rust?
0 I’m currently developing a GQL API in Rust using Actix and Juniper. actix = "0.13.0" juniper = "0.15.11" I’ve managed to create a working environment without issues, however I’ve noticed that Juniper is automatically renaming my Query fields. The code below generates a new field under my QueryRoot which should be named "list_shows" impl…
-
Faster algorithm for max(ctz(x), ctz(y))?
13 For min(ctz(x), ctz(y)), we can use ctz(x | y) to gain better performance. But what about max(ctz(x), ctz(y))? ctz represents "count trailing zeros". C++ Version (Compiler Explorer) #include <algorithm> #include <bit> #include <cstdint> int32_t test2(uint64_t x, uint64_t y) { return std::max(std::countr_zero(x), std::countr_zero(y)); } Rust Version (Compiler Explorer) pub fn test2(x: u64, y: u64) ->…
-
What happens when assigning to the underscore pattern?
17 This is a question from Rust quiz 28: struct Guard; impl Drop for Guard { fn drop(&mut self) { print!("1"); } } fn main() { let _guard = Guard; print!("3"); let _ = Guard; print!("2"); } Such code prints 3121, in the third line of main, assigning to _ means a immediate drop. However,…