Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tom Houlé
    @tomhoule
    Yep
    It's a tough question, but maybe we can start implementing things
    Have you used apollo-codegen before? (I think they renamed it apollo-cli now)
    Because I think the way the CLI works is nice
    Hirokazu Hata
    @h-michael
    Although I have never used it in earnest for development, I have used it for the purpose of checking the operation.
    Tom Houlé
    @tomhoule
    Sorry for the late reply - I have been working on the talk all morning, I'm going to upload the slides now
    Hirokazu Hata
    @h-michael
    Nice slide :thumbsup:
    Tom Houlé
    @tomhoule
    Thanks :) I hope I can find some time to work on graphql-client this weekend. I want to get started on a concrete browser client soon.
    Hirokazu Hata
    @h-michael
    Can I start implementing cli config this weekend?
    Tom Houlé
    @tomhoule
    Of course, feel free to implement your ideas. If you need to discuss I'll probably be hanging out here.
    Maybe we can do that as separate commands, but I think the most ergonomic workflow is to generate modules for all queries in the project (users still have to specify the schema in the config file or as an argument) as separate files next to the .graphql files. Then users can choose to use them or not by just adding a mod my_query to their modules.
    That's a bit hard because we have to figure out where to put the struct that implements the GraphQLQuery trait. Probably inside the module in that case.
    Hirokazu Hata
    @h-michael
    I think so too.
    But if all the queries are in same module user are inconvinience when re-generate added queries after edits this module for custom.
    Tom Houlé
    @tomhoule
    Ideally the generated code shouldn't be edited in my opinion (other libraries add comments saying not to edit - I have seen that in generated protobuf modules for example, with grpc-rs, or what apollo-cli generates).
    Hirokazu Hata
    @h-michael
    ahh, I sometimes want to implement methods to struct in qraphql module.
    For examle, convert value for DB schema.
    I converted boolean value to 0 or 1 for sqlite3.
    Tom Houlé
    @tomhoule
    mmh I see, I hadn't thought about it. I think the impl block can be in a different file. So you can impl my_query::SearchResult from outside the generated code.
    I'll try to check on the playground
    Hirokazu Hata
    @h-michael
    Thanks. I have not fully understood the rust module specification yet.
    it's not as nice because you don't "see" the struct where you implement methods for it
    The other way I would think about solving this is with traits
    Hirokazu Hata
    @h-michael
    Ive understood. Thats allright.
    Tom Houlé
    @tomhoule
    so you implement your methods as a trait, then you derive it or you impl MyTrait for my_query::ResponseData for example. But it's more work.
    Hirokazu Hata
    @h-michael
    I see.
    I will start implementing the sample.
    Joe Narvaez
    @wordyallen
    Is there a patreon for this project?
    Tom Houlé
    @tomhoule
    hey @wordyallen - sorry for the late reply. I am the original author and maintainer for the crate. There is no patreon at the moment, and there are tough questions related to that I don't have answers to (since it's a community project, it's not as simple as funding a single person). I am not developing as actively as I would like at the moment but I hope to get back on it soon. If you have ideas for features you would like to see, I am happy to discuss them on the issue tracker.
    André Zanellato
    @AZanellato
    Hello :)
    I was trying to use this crate in a project and am having trouble generating the schema
    I'm using the CLI (even tried to apollo one) but no such luck :/
    Hirokazu Hata
    @h-michael
    @AZanellato Hi :)
    What troubles do you have?
    Would you show me execute logs or error messages ?
    André Zanellato
    @AZanellato
    I'm sorry @h-michael. Spent quite a bit of time without checking Gitter
    I can try to show you the logs/error messages later today
    resister
    @iot-resister
    hi
    Hirokazu Hata
    @h-michael
    hi
    resister
    @iot-resister

    @h-michael Maybe you can help me ?

    I'm trying to set up juniper on a lambda/faas/severless set up. I'm trying to just execute and introspect on the return response. so far I can return stringified JSON using serde (not sure if I need serde).

    fn handle() {
        // Create a context object.
        let ctx = Ctx(Episode::NewHope);
    
        // Run the executor.
        let (res, _errors) = juniper::execute(
            "query { favoriteEpisode }",
            None,
            &Schema::new(Query, EmptyMutation::new()),
            &Variables::new(),
            &ctx,
        ).unwrap();
    
    // TODO: Run and combine the executor with introspection ??
     // https://graphql-rust.github.io/juniper/current/advanced/introspection.html
    
        // Ensure the value matches.
        serde_json::to_string(&res).unwrap()
    
    }
    Hirokazu Hata
    @h-michael
    @iot-resister You can ask at https://gitter.im/juniper-graphql/Lobby :)
    Rohit Narurkar
    @roynalnaruto
    Hello. I am trying to use the graphql-rust library for the first time. Is there any documentation for implementing subscriptions? What exactly does this mean?
    Subscriptions support (serialization-deserialization only at the moment).
    sparky8251
    @sparky8251

    so, following the provided examples ive tried writing a simple query and compiling but im getting a bizarre error message

    error[E0412]: cannot find type `URI` in module `super`
     --> src/queries/mod.rs:3:10
      |
    3 | #[derive(GraphQLQuery)]
      |          ^^^^^^^^^^^^ not found in `super`
      |
      = note: possible candidate is found in another module, you can import it into scope:
              crate::queries::issue_or_pull::URI
      = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

    ive done the shown use graphql_client::*; like examples say to. any idea why this is coming up?

    Midas Lambrichts
    @MidasLamb
    Hey, i'm trying to help move graphql_client to async await, but i'm having troubles with running tests for wasm locally, can anyone help me with that?
    Suhel Chakraborty
    @forkachild
    How to add support for i16 and others
    Rónán
    @ronanyeah
    Hi, I'm trying to hit Hasura and I need to create a row with a subset of fields
    mutation ItemCreate(items: [Foo!]!) {
      insert_bet(objects: $items) {
        returning {
          id
        }
      }
    }
    This is basically what I need https://github.com/graphql-rust/graphql-client/blob/master/examples/hasura/examples/query_1.graphql
    But my equivalent of issues_insert_input requires fields that I don't want to send like id and created_at. Sending them as None causes postgres to (correctly) complain
    Do I define Foo in Rust or in my .graphql file somewhere?
    Christopher Ricketts
    @chris-ricketts
    Hi, anyone here? Does anyone know of any examples using graphql client over websockets?
    Marek Barvíř
    @barvirm
    Hi, It's possible to call server query just with server scheme and without wrapping it in client query?