-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API Don't create "peripheral" operations by default
When scaffolding Page with a read operation, the default behaviour used to be the creation of readPage, readSiteTree, readRedirectorPage etc. In fact, the readPage query is sufficient, since it returns a union of all these types. The rest is noise, with the slight advantage that types at the end of an inheritance chain (without descendants) get away without unions in the return type. The default behaviour is a bit more useful on create and update operations, since those require a specific input type - unions aren't allowed here. So in order to fully create subclasses, you need createPage vs. createRedirectorPage. I'm proposing that we make this well-documented opt-in behaviour, with the admin/graphql schema opting in for each type on create and update. I don't see a reason why anyone would want to opt in on read or delete. For the more common case where scaffolding is used to create a more limited readonly public schema, this reduces the mental overhead for devs, noise in the schema itself, and cuts down schema generation time because less "helper types" like readRedirectorPageConnectionType are required.
- Loading branch information
Showing
5 changed files
with
120 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
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