-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not require a resolver for "empty" extended types.
Summary: If our schema has a field with a type defined in another service, then we need to define an "empty extend" of that type in this service, so this service knows what the type is like. But the graphql-server will never ask us to actually resolve this "empty extend", so we don't require a resolver function for it. Example: ``` type MyType { myvar: TypeDefinedInOtherService } // Federation needs this type, but it doesn't need a resolver for // it! graphql-server will never ask *us* to resolve a // TypeDefinedInOtherService; it will ask the other service. extend TypeDefinedInOtherService @key(fields: "id") { id: ID @extends } ``` Test Plan: I manually tested this on a service (`assignments`) that we have that fell afoul of this problem. But I had a hard time adding tests inside gqlgen because the error happens at validation-time, and the federation tests are not set up to go that far down the processing path. Reviewers: benkraft, lizfaubell, dhruv Subscribers: #graphql Differential Revision: https://phabricator.khanacademy.org/D61883
- Loading branch information
Showing
2 changed files
with
56 additions
and
25 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
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