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)

Most upvoted comments