Skip to content

How to use graphql_client via a crate that re-exports it? #483

Open
@cameronpickham

Description

@cameronpickham

I've been running into a roadblock trying to set up a crate that re-exports graphql_client and allows users of the crate to define queries using the GraphQL macro without having to add graphql_client to their Cargo.toml. The error that occurs is: failed to resolve: could not find graphql_client in the list of imported crates.

I was able to get my crate to compile by changing this line in graphql_client_codegen from:
fn build_query(variables: Self::Variables) -> ::graphql_client::QueryBody<Self::Variables> {
to
fn build_query(variables: Self::Variables) -> graphql_client::QueryBody<Self::Variables> {

What is the recommendation on how to do this? Is there a way to achieve this functionality without having to change the codegen crate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions