Skip to content

Derive Clone, Serialize and Deserialize for GraphQLRequest and GraphQLResponse #103

Closed
@thomas-jeepe

Description

@thomas-jeepe

For me I need to persist HTTP GraphQL requests and response which is why I need Serialize and Deserialize and then I need to pass them around cloning them.

In order to do so for GraphQLRequest every field is already Serializeable and a simple #[derive(Serialize)], it derives the other traits.

For GraphQLResponse in order to do Deserialize, a custom Deserialize implementation would have to be done. On top of that Clone seems impossible with the GraphQLResponse having borrowed content in the form of a lexer Token<'a> from a parse error.

Changing Token to owning the Name variant would make it possible to clone the response around.

Thats all. It should be relatively simple to implement.

Metadata

Metadata

Assignees

Labels

enhancementImprovement of existing features or bugfixk::apiRelated to API (application interface)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions