Why does the gateway expand interface fragment into multiple implementations fragments? (federation)
See original GitHub issueFor example we have SDL with interface and multiple implementations:
interface Node{
id: ID!
}
type Brand implements Node{
id: ID!
title: String!
}
type Department implements Node{
id: ID!
title: String!
}
type Query{
brand: Brand
}
Then query
{
brand {
... on Node {
id
}
}
}
will be transformed into
Fetch(service: "data") {
{
brands {
... on Brand {
id
}
... on Department {
id
}
}
}
So, the result will be error “Fragment cannot be spread here as objects of type "Brand" can never be of type "Department".”
Why don’t we pass fragments as is?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Federated schema design best practices - Apollo GraphQL Docs
Define, reference, and extend entities as needed. The Apollo Federation specification indicates that an Object or Interface type can be made into an...
Read more >Fragment to Fragment communication - why is the interface ...
Interfaces are best for communicating two fragments, 2 activities or communicate with any class, because interface triggered at same time ...
Read more >Resolve IPv4 Fragmentation, MTU, MSS, and PMTUD ... - Cisco
In Example 2, fragmentation does not occur at the endpoints of a TCP connection because both outgoing interface MTUs are taken into account...
Read more >fragment-limit | Junos OS - Juniper Networks
Adaptive Services Interfaces User Guide for Routing Devices ... the maximum number of fragments permitted in a packet before the packet is dropped....
Read more >Type Merging – GraphQL Tools
The difference in interface fields between the gateway schema and the layouts subschema will automatically be expanded into typed fragments ...
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
Looks like I have fixed this in last commit
@vitramir Ah ok, my bad, got confused thinking there was an app-specific fix. The PR makes sense and fixes the problem in our use case.