Multiple inline fragments - & vs |
See original GitHub issueOn a query like this
dishes {
... on RecipeDish {
id
recipeId
}
... on IngredientDish {
id
ingredient
}
}
The result is
export type Dishes = RecipeDishInlineFragment & IngredientDishInlineFragment
But it should be
export type Dishes = RecipeDishInlineFragment | IngredientDishInlineFragment
Am I not mistaken?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations. ... Every fragment includes a subset...
Read more >How to use GraphQL fragment on multiple types
Gatsby recent release allow users to set up their own types for graphql schema, making this question finally possible.
Read more >GraphQL - Inline Fragments - 4me Learning Center
For example a Translation can be linked to multiple record types: a service, ... An Inline Fragment has the following syntax ...on Type...
Read more >GraphQL fragments explained - LogRocket Blog
A GraphQL fragment lets you build multiple fields, and include them ... "avatarUrl": "https://avatars1.githubusercontent.com/u/1342004?v=4", ...
Read more >How to query your schema with GraphQL fragments
The code to define these fields has to be written multiple times, ... Inline fragments are useful for queries in which we have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@altschuler I wrote the comment above being sure that union is
&
instead ofI
%)apollo-codegen
produces a union for instance, however it doesn’t generate it in a handy form this library does (with subtypes, instead of one long type), which makes it (apollo-codegen) not that usefulok, so I did some work on it, and the results will be:
FIELDS & FRAGMENT_SPREAD & (INLINE_FRAGMENT | INLINE_FRAGMENT | INLINE_FRAGMENT)
. Since fragment spread are in use to specify list of fields in a context of a type, and inline fragments are in use to declare different selection set for interface/union.