Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    theduke
    @theduke
    that PR would just add what you currently have
    I'm a bit busy right now but I can give you some guidance on how this would be implemented later
    brianwk
    @brianwk
    ok
    theduke
    @theduke
    but for now, can't you just use JSON.stringify() / parse() on the client?
    that's fine for a non-public API imo
    Json scalars should be used very sparingly anyway
    Vlady Veselinov
    @vladinator1000
    Hey y'all, is there a way to split your schemas in multiple files?
    image.png
    I'm trying to do something like this to avoid cramming everything in one file. Is that possible?
    Vlady Veselinov
    @vladinator1000
    Also made a repo + issue with some RnD in it graphql-rust/juniper#394
    brianwk
    @brianwk
    I'm having an issue assigning a lifetime to the Context
    brianwk
    @brianwk
    Using juniper and rocket
    Rónán
    @ronanyeah
    is is possible to send multiple/an array of errors back in juniper?
    graphql_client is giving me an array of errors and i'd like to convert them to FieldErrors and pass them back
    theduke
    @theduke
    hey @ronanyeah
    I'm a bit confused, why would you want to send errors from the client to the server?
    Rónán
    @ronanyeah
    i'm using graphql_client to communicate with an external graphql server from inside the juniper server
    and if it sends back gql errors, i'd want to send all of them back through juniper, if that makes sense
    the spec seems to be an array of errors
    Christian Legnitto
    @LegNeato
    Rónán
    @ronanyeah
    thank you, that will be useful for me to further clarify

    an error response from juniper::FieldError::new looks like this:

    {
      "errors": [
        {
          "message": "error 1",
          "locations": [{ "line": 2, "column": 4 }]
        }
      ]
    }

    my question is, is it possible to create something like this?:

    {
      "errors": [
        {
          "message": "error 1",
          "locations": [{ "line": 2, "column": 4 }]
        },
        {
          "message": "error 2",
          "locations": [{ "line": 2, "column": 4 }]
        }
      ]
    }
    Rónán
    @ronanyeah
    i fairly sure the answer is currently no
    would a PR be welcomed?
    Rónán
    @ronanyeah
    Nathan Wilson
    @iancormac84
    Hello. I asked two questions on the Rust Users Discourse forum but didn't get any answers.
    See above for post
    I eventually got through with question number 2, but I'm still having problems converting the Mutation query and its input to JSON so I can pass it in a POST request to the GraphQL server. Any help would be much appreciated!
    Adam Chalmers
    @adamchalmers
    Hi all. If I define a custom scalar, can I use it in fields of both InputObjects and regular (output) Objects?
    theduke
    @theduke
    @adamchalmers yes
    Philipp Mildenberger
    @Philipp-M

    Hey,
    I'd like to combine Juniper and Diesel (using postgres) in an efficient (few and optimized queries) and a minimal boilerplate way:
    I have let's say a model User and a model Post, where a User has a one to many relationship to Post.
    Like this:

    struct Post {
        id: String,
        title: String,
        content: String,
        published_at: DateTime<Utc>,
    }
    struct User {
        id: String,
        name: String,
        posts: Vec<Post>,
    }

    (Note that posts it is not an Option, this is not necessarily a requirement, but would be great to have support for this as well)
    Is there a way to only query the User without querying the posts from the database with a single query like this:

    {
      allUsers {
        id
        name
      }
    }

    and if posts is specified

    {
      allUsers {
        id
        name
        posts {
          title
          published_at
      }
    }

    to extend this to two queries (one for the users, and one for posts). What would be even more optimal: One query, with e.g. json_agg of postgres for the posts to save 'joined overhead'.
    I'm not sure how to achieve this. It would be great to get the queried fields from the request and generate a query for the database based on the queried fields.

    Georg Semmler
    @weiznich
    @Philipp-M Maybe you want to look at wundergraph for this?
    (I really need to finish the documentation and publish it soonish…)
    Philipp Mildenberger
    @Philipp-M
    @weiznich Awesome project, will definitely dig the source code. I have thought about starting something similar (as I really like graphcools/prismas approach). Though I still have to learn the advanced features of Rust like metaprogramming.
    Yeah maybe I can help with the documentation while reading through the source code.
    Do you plan to support many to many relations as well? (correct me if I'm wrong, I have not found support for it while having a quick look over it)
    Georg Semmler
    @weiznich
    @Philipp-M Would be great to have some help with the documentation. I will try to upload that what I've already have written. It not complete but at least some documentation.
    Many to many relations are currently not supported as separate relation type, but they just work using 2 one to many relations, like on schema level.
    (That said, it may be interesting to add some abstraction for them later, but that's after finishing the documentation and finally publishing a version 0.1)
    Alistair A. Israel
    @aisrael
    hi, here. i tried juniper + hyper a month back but discovered it didn't support POST with Content-Type: application/graphql. Did I just miss something or is this (now) supported?
    Vijay Ram
    @selvanram

    Hi, I am now going through the rocket/juniper docs+book+examples and am getting an error on one of my route handlers with the schema param.

    type Schema = RootNode<'static, Query, Mutation>;
    #[post("/graphql", data = "<request>")]
    fn graphql_handler(
      context: DbConn,
      request: juniper_rocket::GraphQLRequest,
      schema: Schema,
    ) -> juniper_rocket::GraphQLResponse {
      request.execute(&schema, &context)
    }

    The error I'm getting is:

    the trait `rocket::request::FromRequest<'_, '_>` is not implemented for `juniper::schema::model::RootNode<'static, Query, Mutation>`

    Am I required to implement this trait for the RootNode? I don't see that in any of the examples I've looked at so far. (I'm likely missing something obvious).

    Felipe Passos
    @SharksT
    It is possible to separate the schema in multiple files ?
    theduke
    @theduke
    @SharksT you can split your types across as many fields as you want, but the query and mutation type need to be in one file for now.
    @selvanram see the example
    you need to provide the schema with the State feature of rocket
    @aisrael please create an issue for that
    Felipe Passos
    @SharksT
    Hello
    Felipe Passos
    @SharksT

    How do i implement a BigDecimal scalar ?
    ``the trait boundbigdecimal::BigDecimal: juniper::GraphQLType<__S>` is not satisfied

    the trait juniper::GraphQLType<__S> is not implemented for bigdecimal::BigDecimal
    ```

    I know that is possible :graphql-rust/juniper#251 , don't know how.
    Georg Semmler
    @weiznich
    Basically you need to implement your own scalar type value and use that everywhere. The linked PR has an example how to do this if I remember correctly.