-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify Field{Read,Merge}Options as much as possible, for consistency.
Although it was tempting to make the read function feel like a GraphQL resolver function (parentObject, args, context, info), that signature would not have been appropriate for the merge function, and having to remember two totally different signatures for reading and merging did not seem ideal. Now, the only difference between the signatures is that the merge function takes incoming data, to be merged with the existing data (if any): read(existing, { args, parentObject, field, variables }) merge(existing, incoming, { args, parentObject, field, variables }) It would have been nice to use named options for everything, including the existing and incoming parameters, but it's important for those parameters to be positional so that the developer can specify their types, without also having to provide a new type for the entire options object.
- Loading branch information
Showing
6 changed files
with
72 additions
and
74 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
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
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