graphql-rust / graphql-client

Typed, correct GraphQL requests and responses in Rust
Apache License 2.0
1.12k stars 152 forks source link

Allow using `#[derive(GraphQLQuery)]` without depending on serde #487

Open swlynch99 opened 1 month ago

swlynch99 commented 1 month ago

This PR makes the serde derives emitted by #[derive(GraphQLQuery)] use a private re-export of the serde crate instead of relying on users of this crate having added serde to their Cargo.toml.

Serde allows you to add an annotation

#[serde(crate = "<path to crate>")]

for exactly this reason so most of this PR is just plumbing the correct path through the codegen crate to the correct annotation.

Details

Fixes #427