graphql-client: Unable to use inline fragment - Complex data-type
I’m trying to consume the enum from a complex query that involves inline fragments. However, I’m unable to get any of the fragments, neither the as<Fragment Name>, as mentioned in some documents. Any advice would be much appreciated 🙏.
#[derive(GraphQLQuery)] #[graphql( schema_path = "src/schemas/pluralsight_schema.graphql", query_path = "src/queries/pluralsight_queries.graphql", response_derives = "Debug, Serialize, Deserialize, PartialEq, Clone" )] struct ChannelContent;
query ChannelContent($channelId: String!) { channelContent(first: 1000, filter: { channelId: $channelId }) { nodes { id channelId index type __typename ... on Section { name description content { id index type __typename ... on ExternalLinkSection { url title contentType level durationInSeconds } } } __typename ... on ExternalLink { url title contentType level durationInSeconds } } } }
Any example or post would also do, on how to process these kind of complex queries.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (4 by maintainers)
What is missing from
channel_content::ResponseData? There are tests using inline fragments, e.g. https://github.com/graphql-rust/graphql-client/blob/c52e89e19c462739e9e61fab37224ea524f7a787/graphql_client/tests/type_refining_fragments.rs#L20