-
-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
311 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
"@graphql-tools/federation": patch | ||
"@graphql-tools/delegate": patch | ||
"@graphql-tools/stitch": patch | ||
--- | ||
|
||
When there is a Node subschema, and others to resolve the rest of the entities by using a union resolver as in Federation like below, it was failing. This version fixes that issue. | ||
|
||
```graphql | ||
query { | ||
node(id: "1") { | ||
id # Fetches from Node | ||
... on User { | ||
name # Fetches from User | ||
} | ||
} | ||
} | ||
``` | ||
|
||
```graphql | ||
type Query { | ||
node(id: ID!): Node | ||
} | ||
|
||
interface Node { | ||
id: ID! | ||
} | ||
|
||
type User implements Node { | ||
id: ID! | ||
} | ||
|
||
type Post implements Node { | ||
id: ID! | ||
} | ||
``` | ||
|
||
```graphql | ||
# User subschema | ||
scalar _Any | ||
type Query { | ||
_entities(representations: [_Any!]!): [_Entity]! | ||
} | ||
union _Entity = User | ||
interface Node { | ||
id: ID! | ||
} | ||
type User implements Node { | ||
id: ID! | ||
name: String! | ||
} | ||
``` | ||
|
||
```graphql | ||
# Post subschema | ||
scalar _Any | ||
union _Entity = Post | ||
type Query { | ||
_entities(representations: [_Any!]!): [_Entity]! | ||
} | ||
interface Node { | ||
id: ID! | ||
} | ||
type Post implements Node { | ||
id: ID! | ||
title: String! | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,6 @@ export function delegateToSchema< | |
context, | ||
info, | ||
}); | ||
|
||
return delegateRequest({ | ||
...options, | ||
request, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.