docs: add first guide for schema governance series#2267
Conversation
|
@sarahxsanders is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
@sarahxsanders is this ready? Do you need feedbacks on this? |
|
@martinbonnin yes this is ready! |
|
Awesome @sarahxsanders ! I'll review now! @benjie @hasparus Do you have access to Vercel to approve the preview? |
Urigo
left a comment
There was a problem hiding this comment.
great work, I won't comment here but some of the comments I've made in the other PR but in high level some of them are related here as well
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Vercel is reporting the same issue as CI, which I believe was addressed in the comments above. |
| Dangerous changes that may break some clients include: | ||
|
|
||
| - **Adding enum values**: If clients exhaustively match enum values | ||
| - **Adding fields to input types**: If clients use spread operators to construct input objects |
There was a problem hiding this comment.
I would very much like that we change the narrative from "this is dangerous by default" to "this should be safe unless your frontend doesn't support it".
| Dangerous changes that may break some clients include: | |
| - **Adding enum values**: If clients exhaustively match enum values | |
| - **Adding fields to input types**: If clients use spread operators to construct input objects | |
| Some changes may break applications that did not plan for schema evolution: | |
| - **Adding enum values**: If application code exhaustively match enum values | |
| - **Adding new types to an union or interface**: If application code exhaustively match the type name | |
| - **Adding fields to input types**: If application code use spread operators to construct input objects | |
| Such applications make schema evolution harder and writing robust applications is encouraged. | |
| If in doubt, use caution when doing those changes. |
I wrote a "Robust Applications" best practice PR there that we could then link from here.
| - **Adding enum values**: If clients exhaustively match enum values | ||
| - **Adding fields to input types**: If clients use spread operators to construct input objects | ||
|
|
||
| Codegen tools can break on schema changes that are technically backwards compatible. Adding a new field to a type may cause TypeScript codegen to fail if existing queries don't request that field, depending on how the codegen tool handles schema evolution. |
There was a problem hiding this comment.
I'm not sure I understand this one. Did you have an example?
Description
adds the first guide for the new "schema governance" guides for graphql.org/learn
includes new guide: review and validate schema changes:
Note
next guides are on: