profile
viewpoint
Christian Legnitto LegNeato Robinhood San Francisco Ex-@facebook, ex-@mozilla, ex-@apple. Engineering manager who pretends he can still code and does it as much as possible.

graphql-rust/graphql-client 534

Typed, correct GraphQL requests and responses in Rust

LegNeato/asciinema-rs 50

Asciinema client written in Rust

LegNeato/bztools 32

Models and scripts to access the Bugzilla REST API.

LegNeato/aws-lambda-events 28

Rust event types for AWS Lambda

LegNeato/bugzilla-push 12

A Bugzilla extension that enables integration with a message broker via AMQP or STOMP

jbalogh/bztools 2

Models and scripts to access the Bugzilla REST API.

LegNeato/asciicast-rs 2

Rust library for the Asciicast file format used by Asciinema

LegNeato/atom-in-orbit 2

Putting Atom in the browser

LegNeato/carrot 2

AMQP Messaging Framework for Python

LegNeato/adbkit-apkreader 0

Extracts information from APK files.

issue closedgraphql-rust/juniper

Field type not found on type Mutation

I defined a struct which has a type field

#[derive(Debug, Serialize, Deserialize, Clone, juniper::GraphQLObject, Default)]
pub struct A {
    no: i32,
    name: String,
    type: String,
}

and the compiler tell me, it can't accept this, so I changed to fix it.

580 |     type: String,
    |     ^^^^ expected identifier, found keyword
    |
help: you can escape reserved keywords to use them as identifiers
    |
580 |     r#type: String,
    |     ^^^^^^
#[derive(Debug, Serialize, Deserialize, Clone, juniper::GraphQLObject, Default)]
pub struct NewA {
    no: i32,
    name: String,
    r#type: String,
}

and the graphiQL is printed well.

Screen Shot 2020-09-19 at 12 27 08 PM

but when I requested this Object, I got this error

thread 'actix-web' panicked at 'Field type not found on type Mutation', src/model/response_models.rs:576:48

it looks like the juniper::GraphQLObject doesn't identify this keyword field, and I wanna know the specified reason and the possible solutions.

thx all~

closed time in 5 hours

dwgeneral

issue commentgraphql-rust/juniper

Field type not found on type Mutation

Ah, this should be fixed on master. We are cutting a new release soon!

dwgeneral

comment created time in 5 hours

issue commentgraphql-rust/juniper

Field type not found on type Mutation

Which version are you using? Crates.io or master?

dwgeneral

comment created time in a day

issue openedgraphql-rust/juniper

Investigate using rowan for parsing

https://docs.rs/rowan/0.10.0/rowan/index.html

See https://rdambrosio016.github.io/rust/2020/09/18/pure-ast-based-linting-sucks.html#problems-with-asts

created time in 2 days

startedstateright/stateright

started time in 3 days

pull request commentgraphql-rust/juniper

Allow disabling case convertion

Ugh, sorry...read that way too fast and was fried from work. You're right, ignore #2 :-)

ip1981

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

startedRDambrosio016/RSLint

started time in 5 days

issue commentgraphql-rust/graphql-parser

Name/TypeName/StringValue AST Node?

This seems like a good addition!

xuorig

comment created time in 5 days

startedCertainLach/jrsonnet

started time in 7 days

pull request commentgraphql-rust/juniper

Update graphql-ws keep-alive docs

👏

ccbrown

comment created time in 8 days

pull request commentgraphql-rust/juniper

actix updated to latest version and actix rt removed

Thank you very much!

kunjee17

comment created time in 8 days

push eventgraphql-rust/juniper

Kunjan Dalal

commit sha 8b79f5b1f1e7969f92467db62a9d128fec58b1f2

Update Actix to the latest version (#761) * actix updated to latest version and actix rt removed * actix rt added back as dev dep

view details

push time in 8 days

PullRequestReviewEvent

push eventgraphql-rust/juniper

Juniper Bot

commit sha 9b036f113073d1194e7386a476d03f86f5e89752

Updated book for master ***NO_CI***

view details

push time in 10 days

issue commentgraphql-rust/juniper

Efficient generation of SQL queries

Hmmm. If you are talking about generating a SQL query in resolvers, there is dataloader and juniper-eager-loading as two strategies to prevent inefficiencies.

If you want to translate a SQL query to a GraphQL query, you don't need juniper at all as it would just take in the translated GraphQL query.

If you want to translate the schema to an SQL table (similar to hasura), you can get the schema as a graphql-parser document and translate from that.

What do you want to do?

bostontrader

comment created time in 10 days

push eventgraphql-rust/juniper

Thomas Radloff

commit sha 092a9851fbad5e848167b61dccfe48101cd6eea7

Fix version. (#755) Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>

view details

push time in 10 days

PR merged graphql-rust/juniper

Fix version.

I have found a number of issues with The Book. I'm willing to make some pull requests to clean up said issues. I am submitting this small and simple pull request as a hello-pull-request to get the ball rolling. If you all would rather I amend this to include more issues, then please let me know and I will.

+1 -1

1 comment

1 changed file

bostontrader

pr closed time in 10 days

push eventbostontrader/juniper

Kai Ren

commit sha dac4e648c1873fe5c32f901aca78e806b1e39f67

Fix LookAheadMethods lifetimes (#757)

view details

Jerel Unruh

commit sha 0bf5e3cfa91d2366a2d3c4b57261d994e70c5b47

Reduce juniper_graphql_ws default KA to 15 seconds so that GQL clients don't disconnect (#756)

view details

Christian Legnitto

commit sha 293dfb898ed1591a9f9968b90cbb80c52b60e900

Merge branch 'master' into tfr-book

view details

push time in 10 days

push eventgraphql-rust/juniper

Jerel Unruh

commit sha 0bf5e3cfa91d2366a2d3c4b57261d994e70c5b47

Reduce juniper_graphql_ws default KA to 15 seconds so that GQL clients don't disconnect (#756)

view details

push time in 10 days

issue closedgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

Describe the bug When running the latest examples/warp_subscriptions app locally the websocket silently dies after ~20 seconds. I suspect that there's an issue with the keepalive functionality but haven't been able to track it down. If config.with_keep_alive_interval(0) is used the socket stays open. If config.with_keep_alive_interval(Duration::from_secs(15)) is used it also stays open, however if the default is left (30) or it's manually set to > 25 with with_keep_alive_interval the socket will die after a few seconds.

To Reproduce Steps to reproduce the behavior:

  1. Run the example app
  2. Execute subscription { users { id } } in GraphiQL
  3. After ~20 seconds the socket will disconnect

Expected behavior The socket should remain open permanently. It would be nice if a log event was generated when the socket closes (crashes?).

closed time in 10 days

jerel
PullRequestReviewEvent

push eventgraphql-rust/juniper

Kai Ren

commit sha dac4e648c1873fe5c32f901aca78e806b1e39f67

Fix LookAheadMethods lifetimes (#757)

view details

push time in 10 days

PR merged graphql-rust/juniper

Fix LookAheadMethods lifetimes enhancement

Revealed from #682

Synopsis

The LookAheadSelection and ConcreteLookAheadSelection are mostly reference types: part of their data is a reference to some outer value.

The current LookAheadMethods trait (which abstracts public interface to these two selections) cannot express this notion, however. This result in the situation:

let name: &'static str = "my_string";
let executor: Executor<'static, _> = Executor::create_from(&name);  // just imitating

let field_name: &'static str = executor.look_ahead().field_name();  // fails to compile

Compilation fails because field_name has the lifetime of a temporary value, returned by executor.look_ahead() (which acts as a reference in this case). This happens because LookAheadMethods::field_name bounds returned value to the &self lifetime, not the lifetime that Self points to, as it should be.

Solution

Introduce a lifetime parameter in LookAheadMethods trait, so we could express the referencing to some outer values when implementing this trait.

+13 -10

0 comment

1 changed file

tyranron

pr closed time in 10 days

PullRequestReviewEvent

startedDroidTest/TimeMachine

started time in 11 days

issue commentgraphql-rust/juniper

Get context in interface field resolvers

Hmm, I think something similar should work but haven't looked at release version in a long time. After https://github.com/graphql-rust/juniper/pull/682 lands this should be fixed on master.

stijnfrishert

comment created time in 11 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

I'd take a PR to make the default 15 seconds, sounds like that will work for Graphiql and the playground!

jerel

comment created time in 12 days

issue commentgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

It looks like graphiql uses https://github.com/apollographql/subscriptions-transport-ws under the hood. According to the readme the default is 30000 ms.

There is probably something wonky here where the playground is 20 secs but we need 15 to actually work. I wonder if we are sending it too late or the clients are starting to count too early?

jerel

comment created time in 14 days

startedautomerge/automerge-rs

started time in 15 days

issue commentgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

(note there is a potential fence post / counting problem here on both sides)

jerel

comment created time in 16 days

issue commentgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

Actually, reopening. I wonder if we are using just simple durations between keep alive pings instead of checking that we get pings in x second bucket intervals.

jerel

comment created time in 16 days

IssuesEvent

issue closedgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

Describe the bug When running the latest examples/warp_subscriptions app locally the websocket silently dies after ~20 seconds. I suspect that there's an issue with the keepalive functionality but haven't been able to track it down. If config.with_keep_alive_interval(0) is used the socket stays open. If config.with_keep_alive_interval(Duration::from_secs(15)) is used it also stays open, however if the default is left (30) or it's manually set to > 25 with with_keep_alive_interval the socket will die after a few seconds.

To Reproduce Steps to reproduce the behavior:

  1. Run the example app
  2. Execute subscription { users { id } } in GraphiQL
  3. After ~20 seconds the socket will disconnect

Expected behavior The socket should remain open permanently. It would be nice if a log event was generated when the socket closes (crashes?).

closed time in 16 days

jerel

issue commentgraphql-rust/juniper

juniper_graphql_ws silently closes the socket

There is no default keepalive value for GraphQL clients, so it is up to you to set it for your particular use-case.

See this in the example:

https://github.com/graphql-rust/juniper/blob/45c16acc6e6dba9cf32e075d4516a9ab7c6fe780/examples/actix_subscriptions/src/main.rs#L101

We actually probably shouldn't even provide a default and make consumers specify it. Though if clients are all starting to default to the same value happy to take a patch.

jerel

comment created time in 16 days

pull request commentgraphql-rust/juniper

WIP: 🔬 Make interfaces great again!

Yeah, I have been slammed at work but planning on putting in some polish for the release. Ok, carry on and hopefully I can nibble at the edges to help.

tyranron

comment created time in 16 days

pull request commentbostontrader/bookwerx-core-rust

This now compiles.

Excellent, I am glad you got it working! 🚀

LegNeato

comment created time in 17 days

pull request commentgraphql-rust/juniper

WIP: 🔬 Make interfaces great again!

Is there some disconnected work outstanding I can help with? Don't want to get in your way but also want to help out where I can.

tyranron

comment created time in 17 days

push eventmihai-dinculescu/juniper

Caio

commit sha 2ab00f55d620c51b8732c97c90f8f3349c2e6a0b

Remove unused dependencies (#747)

view details

Kai Ren

commit sha a684e1d91cea0a33ef1a9c76a5f7e236d149ea3e

Re-enable marks-based static checks in code generated by macros (#751) - add associated type to IntoResolvable and IntoFieldResult traits allowing to name the GraphQLType being resolved - relax Sized requirement on some IsInputType and IsOutputType impls

view details

tyranron

commit sha 0f400c37999476c93a147a071ef3fdefcfd03afe

Fmt `juniper_actix` crate

view details

Christian Legnitto

commit sha 5f8a4ca61b21e5d2299ae79a67685e2ef5524ed3

Merge branch 'master' into add_tracing_support

view details

push time in 18 days

pull request commenttokio-rs/tracing

tracing: Instrument std::future::Future in tracing

Any update on this?

davidbarsky

comment created time in 18 days

push eventgraphql-rust/juniper

Kai Ren

commit sha a684e1d91cea0a33ef1a9c76a5f7e236d149ea3e

Re-enable marks-based static checks in code generated by macros (#751) - add associated type to IntoResolvable and IntoFieldResult traits allowing to name the GraphQLType being resolved - relax Sized requirement on some IsInputType and IsOutputType impls

view details

tyranron

commit sha 0f400c37999476c93a147a071ef3fdefcfd03afe

Fmt `juniper_actix` crate

view details

Christian Legnitto

commit sha 0c935380eec53e28307674c5eb71b966daa98e6f

Merge branch 'master' into async-interfaces

view details

push time in 18 days

push eventLegNeato/bookwerx-core-rust

Christian Legnitto

commit sha 5a796e35b7d160266be34c5bff385fa4f3736d09

This now compiles. Two things: 1. updated to Juniper master. While not strictly necessary, we are doing a release soon so this is what it will need to be. It also lets you use rocket async if you want. 2. I have never used rocket so I have no clue if this is right...but it compiles at least. I don't have a local db for testing, sorry.

view details

push time in 18 days

issue closedgraphql-rust/juniper

Juniper/Rocket/MySQL integration

I'm having a difficult time getting Rust, Juniper/GraphQL, and MySQL to all work together. This problem is compounded by the fact that each piece is working just fine, it's the integration that is a problem. So who shall I beg insight from?

As Rocketeers know, Rocket has a method for connecting to MySQL. It involves creating an object, in my example I'll call it MyRocketSQLConn, and feeding said object to any route handlers that need a connection to MySQL. This part works just fine.

As Junipeters know, Juniper defines a query, schema, and context that are also fed to any Rocket route handlers that need them. The route handler will invoke query.execute(schema, context) to do its thing. This part also works just fine.

I can successfully deliver MyRocketSQLConn, Query, Schema, and Context into a route handler, but get stuck shortly thereafter.

In the examples that I've seen Context has been used to hold a toy database but it looks like an obvious place to inject MyRocketSQLConn into the Juniper works. Unfortunately this is trouble. The basic reason for this is that the context is immutable for reasons of thread safety and I would need to use inner mutability to inject MyRocketSQLConn into this.

I have come tantalizingly close to a solution by adding a field to the Juniper Context object, which I call JunDatabase:

pub struct JunDatabase {
    pub conn: Arc<Mutex<Option<MyRocketSQLConn>>>,
}

The Arc and Mutex deal with the thread safety issues. I need Option because I must create the Juniper Context before I have instantiated MyRocketSQLConn.

So the route handler that I have is:

#[rocket::post("/graphql", data = "<request>")]
fn post_graphql_handler(
    context: State<M::JunDatabase>,
    request: juniper_rocket::GraphQLRequest,
    schema: State<Schema>,
    mut conn: MyRocketSQLConn
) -> juniper_rocket::GraphQLResponse {

    {
        let m = &*context.conn;
        let mut m1 = m.lock().unwrap();
        *m1 = Some(conn);
    }

    request.execute(&schema, &context)

}

This part works just fine and execution will eventually get to:

fn helloJuniper(database: &JunDatabase) -> i32 {
    let m1 = &*database.conn;
    let m2 = m1.lock().unwrap().as_ref().unwrap();

    ...
}

At this point the code compiles and upon execution m2 is a &MyRocketSQLConn. This is where I'm stumped.

The basic issue is that, depending upon which of the 99,000 subsequent variations I try, the error messages generally complain about moves, borrows, mutability, and lifetimes. I have a general understanding of these issues individually, but undoubtedly have more to learn about these topics.

Given one particular guess yields:

let m3 = (*m2).prep_exec(...);
^^^^^ `m2` is a `&` reference, so the data it refers to cannot be borrowed as mutable

I'll spare you the loooong list of guesses that I've made about this as I thrash hopelessly hoping that the infinite monkey battalion can succeed in the absence of divine insight. If I'm missing a magic * somewhere, I'd be happy to have my nose rubbed in that fact. But I'd really like to hear some ideas for a general purpose approach to dealing with this issue.

Thank you.

closed time in 18 days

bostontrader

issue commentgraphql-rust/juniper

Juniper/Rocket/MySQL integration

https://github.com/bostontrader/bookwerx-core-rust/pull/1 allows it to compile but don't know if it is the right thing to do for rocket. Let me know if it is still an issue or if that solves it!

bostontrader

comment created time in 18 days

PR opened bostontrader/bookwerx-core-rust

This now compiles.

Two things:

  1. updated to Juniper master. While not strictly necessary, we are doing a release soon so this is what it will need to be. It also lets you use rocket async if you want.

  2. I have never used rocket so I have no clue if this is right...but it compiles at least. I don't have a local db for testing, sorry.

+730 -502

0 comment

6 changed files

pr created time in 18 days

push eventLegNeato/bookwerx-core-rust

Christian Legnitto

commit sha a4f89f0a0cba9c902f3e7b42275e871718006847

This now compiles. Two things: 1. updated to Juniper master. While not strictly necessary, we are doing a release soon so this is what it will need to be. It also lets you use rocket async if you want. 2. I have never used rocket so I have no clue if this is right...but it compiles at least. I don't have a local db for testing, sorry.

view details

push time in 18 days

create barnchLegNeato/bookwerx-core-rust

branch : now_compiles

created branch time in 18 days

fork LegNeato/bookwerx-core-rust

A double-entry bookkeeping engine that supports multiple currencies, written in Rust.

fork in 18 days

issue closedgraphql-rust/juniper

juniper_hyper in cartes.io needs to be updated?!

I'm very very a newbie in rust and juniper. I've installed juniper_hyper using cargo. The problem was I get an compile error with this code.

juniper_hyper::playground("/graphql").await
// Error: the trait bound `impl futures::future::Future: std::future::Future` is not satisfied
// required by `std::future::Future::poll`rustc(E0277)

Maybe, I think because this juniper_hyper uses futueres 0.1.29, so it can't use async/await syntax. juniper_hyper 0.5.2 in Crates.io has futures^0.1 dependency So, juniper_hyper needs to be updated to use futures 0.3^ which can use async/await syntax.

And also, I'm wondering why Cargo.toml of juniper_hyper 0.5.2 has futures 0.3.1 dependency, while juniper_hyper in Crates.io has futures^0.1.

Thank you.

closed time in 18 days

seunghunee

issue commentgraphql-rust/juniper

juniper_hyper in cartes.io needs to be updated?!

Hello! Yes, the crates.io release is only compatible with an older hyper unless you use the compat layer of the futures crate. I would suggest using master of juniper and juniper_hyper until we do another release (soon, see https://github.com/graphql-rust/juniper/issues/737).

For version numbers on master, we only bump when doing a release so what is on master is not what is on crates.io even though the version numbers appear to be the same.

seunghunee

comment created time in 18 days

PullRequestReviewEvent

pull request commentgraphql-rust/juniper

WIP: 🔬 Make interfaces great again!

This is such great work!!!

tyranron

comment created time in 18 days

issue commentgraphql-rust/juniper

Juniper/Rocket/MySQL integration

Is your WIP code open source? Happy to take a look.

bostontrader

comment created time in 19 days

startedronniec95/black_scholes

started time in 19 days

startedekzhang/crepe

started time in 19 days

pull request commentgraphql-rust/juniper

Re-enable markers static checking in generated code

Ah sorry, didn't appear in draft on my phone!

tyranron

comment created time in 19 days

pull request commentgraphql-rust/juniper

Re-enable markers static checking in generated code

Looks like failures are legit.

tyranron

comment created time in 19 days

PullRequestReviewEvent

issue commentgraphql-rust/juniper

Expose the fields of GraphQLRequest

Hmm, I thought operation name was public, perhaps it got dropped:

https://github.com/graphql-rust/juniper/pull/265/commits

sessionboy

comment created time in 20 days

issue commentgraphql-rust/juniper

GraphQL schema stiching

This doesn't need to be in Juniper though, right? From what I know (not much!) It is probably handled by a higher level that chooses this part of the graph -> call juniper::execute(), other parts of the graph, do X.

Am I thinking about it wrong here?

Type1J

comment created time in 21 days

push eventgraphql-rust/juniper

Mihai Dinculescu

commit sha 45c16acc6e6dba9cf32e075d4516a9ab7c6fe780

Actix subscriptions tests (#736) * Actix subscriptions tests * Use LocalBoxFuture instead of async-trait * expose-test-schema already includes serde_json * Add anyhow to juniper dev-dependencies * The HTTP test helpers are not needed for juniper tests * juniper_actix does not need tokio in dev-dependencies Co-authored-by: Christian Legnitto <LegNeato@users.noreply.github.com>

view details

samuela

commit sha 368ea6f96f375e03d596cb848975264662e28ba2

remove unnecessary moves (#740)

view details

Caio

commit sha 2ab00f55d620c51b8732c97c90f8f3349c2e6a0b

Remove unused dependencies (#747)

view details

Christian Legnitto

commit sha 469412aa784e01d16fe45ad1143a423ad8531241

Merge branch 'master' into async-interfaces

view details

push time in 21 days

issue closedgraphql-rust/juniper

Consider release 0.15 on crates.io

Is your feature request related to a problem? Please describe. It's been 9 months since the last release of Juniper on crates.io. Many nice features are added in master branch, and people are using master branch as their dependency. However the iteration is fast, and people may found their code broken due to minor issues like file/folder relocation.

Describe the solution you'd like A new release version on crates.io.

Describe alternatives you've considered Find a revision in master branch and suggest people using the revision for development.

closed time in 21 days

LHY-iS-Learning

issue commentgraphql-rust/juniper

Consider release 0.15 on crates.io

Just waiting for async interfaces to land! This is a dupe of https://github.com/graphql-rust/juniper/issues/737.

LHY-iS-Learning

comment created time in 21 days

issue commentdavidpdrsn/juniper-from-schema

Add support for subscriptions

FWIW we are leaving the sync code in.

caass

comment created time in 22 days

starteddropbox/dbx_build_tools

started time in 23 days

issue closedgraphql-rust/juniper

Implement Subscriptions for juniper-actix

It would be awesome to have subscriptions in juniper-actix.

I'm willing to put effort into making it happen, but I will need some guidance.

closed time in 23 days

mihai-dinculescu

issue commentgraphql-rust/juniper

Implement Subscriptions for juniper-actix

Looks like this landed, thank you!

mihai-dinculescu

comment created time in 23 days

issue closedgraphql-rust/juniper

New crates.io release?

Possible to do a new crates.io release soon?

Been 8 months since the last one and there are a few merged PRs that we would like to use in a published release

closed time in 23 days

repi

issue commentgraphql-rust/juniper

New crates.io release?

Soon! Please see https://github.com/graphql-rust/juniper/issues/737

repi

comment created time in 23 days

pull request commentgraphql-rust/juniper

Remove unused dependencies

Thank you! This has been on my TODO.

c410-f3r

comment created time in 23 days

push eventgraphql-rust/juniper

Caio

commit sha 2ab00f55d620c51b8732c97c90f8f3349c2e6a0b

Remove unused dependencies (#747)

view details

push time in 23 days

PR merged graphql-rust/juniper

Remove unused dependencies

juniper brings a lot of weight and compilation times into my projects and this PR is an attempt to decrease this burden.

Local tests say that cargo build/check/test will now have ~8 less crates to download and the used technique can be further extended into other projects (juniper_actix, juniper_warp, etc) to decrease CI times.

+11 -11

0 comment

2 changed files

c410-f3r

pr closed time in 23 days

PullRequestReviewEvent

startedmaidsafe/crdt_tree

started time in 23 days

issue commentgraphql-rust/juniper

Investigate using const functions

As can the schema file?

LegNeato

comment created time in 24 days

issue commentgraphql-rust/juniper

Investigate using const functions

At the very least the introspection query can be figured out at build time I think...it only depends on the schema and the query is static.

LegNeato

comment created time in 24 days

issue openedgraphql-rust/juniper

Investigate using const functions

Const functions could possibly be used to handle certain things at compile time. We should investigate.

created time in 24 days

issue closedgraphql-rust/juniper

Enum interfaces don't seem to work when using juniper::object

I'm building an interface using the enum pattern as per the book.

This works when I use #[derive(juniper::GraphQLObject)] for my cases. However, as soon as I switch over to using #[juniper::object(Context = Context)], I get a compilation error:

the trait bound `graph::Graph: juniper::GraphQLType<S>` is not satisfied
required because of the requirements on the impl of `juniper::GraphQLType<S>` for `&graph::Graph`

What's up with that? Does anyone know how to solve this?

Here's my interface implementation:

#[derive(juniper::GraphQLObject)]
pub struct Timeline {
    pub id: ID,
    pub name: String,
}

pub struct Graph {
    pub id: ID,
    pub name: String,
}

#[juniper::object(
    Context = Context,
)]
impl Graph {
    fn id(&self) -> &ID {
        &self.id
    }

    fn name(&self) -> &str {
        &self.name
    }
}

pub enum Event {
    Graph(Graph),
    Timeline(Timeline),
}

juniper::graphql_interface!(Event: () where Scalar = <S> |&self| {
    field id() -> &str {
        match *self {
            Event::Graph(Graph { ref id, .. }) |
            Event::Timeline(Timeline { ref id, .. }) => id,
        }
    }

    field name() -> &str {
        match *self {
            Event::Graph(Graph { ref name, .. }) |
            Event::Timeline(Timeline { ref name, .. }) => name,
        }
    }

    instance_resolvers: |_| {
        &Graph => match *self { Event::Graph(ref g) => Some(g), _ => None },
        &Timeline => match *self { Event::Timeline(ref t) => Some(t), _ => None },
    }
});

closed time in 24 days

stijnfrishert

issue commentgraphql-rust/juniper

Enum interfaces don't seem to work when using juniper::object

Apologies, interfaces are broken in master until https://github.com/graphql-rust/juniper/pull/682 lands.

stijnfrishert

comment created time in 24 days

issue closedgraphql-rust/juniper

GraphQL schema stiching

Is your feature request related to a problem? Please describe. I would like to be able to specify that part of my schema is found on an upstream server, and I'd like it updated when an upstream server updates.

A clear and concise description of what the problem is. I can't combine my microservices without using Apollo Server.

Describe the solution you'd like I'd like a way to point to a server to fill in the types that the current server doesn't know about, and then be able to return one of those types in a resolver. I'd also like input types to be proxied through as well.

Describe alternatives you've considered Apollo Server can do schema stiching, and may be a good starting place for how it should be done in Juniper.

closed time in 24 days

Type1J

issue commentgraphql-rust/juniper

GraphQL schema stiching

We will likely never support this. Juniper's schema is defined at compile time, not runtime.

Type1J

comment created time in 24 days

startedwildarch/blackjack

started time in a month

startedsayrer/twitter-text

started time in a month

startedgrapl-security/grapl

started time in a month

issue commentgraphql-rust/juniper

#[juniper::graphql_object] != #[derive(juniper::GraphQLObject)]

Ah yeah, that's what I figured but wanted to confirm there wasn't any wonkiness going on with our async handling

olvyko

comment created time in a month

Pull request review commentgraphql-rust/juniper

Add tracing support

 where          let errors = ctx.into_errors();         if !errors.is_empty() {-            return Err(GraphQLError::ValidationError(errors));+            let gql_error = GraphQLError::ValidationError(errors);+            __juniper_trace!("GraphQLError: {:?}", gql_error);

Agreed, will fix.

mihai-dinculescu

comment created time in a month

PullRequestReviewEvent

Pull request review commentgraphql-rust/juniper

Add tracing support

+[package]+name = "tracing_support"+version = "0.1.0"+authors = ["Christian Legnitto <christian.legnitto@robinhood.com>"]

Yep, good catch! Will change

mihai-dinculescu

comment created time in a month

PullRequestReviewEvent

issue closedgraphql-rust/juniper

Support using GraphQLInputObject as output

For some reason I can't use GraphQLInputObject as output or I get "Introspection must provide output type for fields". so I have to make copies of the same type for output. I think this hassle is completely avoidable. Opening this issue hoping this get fixed.

closed time in a month

zyddnys

issue commentgraphql-rust/juniper

Support using GraphQLInputObject as output

Dupe of https://github.com/graphql-rust/juniper/issues/173.

zyddnys

comment created time in a month

startedEamonnMR/OpenLockstep

started time in a month

pull request commentsamuela/juniper_hyper_broken

Make build, test, and run work.

Not currently as async is only on master. We are doing a release soon though!

LegNeato

comment created time in a month

created tagLegNeato/aws-lambda-events

tagv0.3.1

Rust event types for AWS Lambda

created time in a month

push eventLegNeato/aws-lambda-events

Christian Legnitto

commit sha f3822e770cc2f7b1cc04e2e57194c66e2a913ab4

Release 0.3.1

view details

Christian Legnitto

commit sha c802ff729943237037bc1054cb0ad637356e9433

Bump version to 0.3.1

view details

push time in a month

more