jarwol / graphql-schema-utils Goto Github PK
View Code? Open in Web Editor NEWExtensions for graphql-js to support diffing and merging types and schemas.
License: MIT License
Extensions for graphql-js to support diffing and merging types and schemas.
License: MIT License
I've just seen an issue where a backwards incompatible change has been detected, when a field went from optional to required in the API output.
I'm not sure that this should be backwards incompatible?
Field type changed on field User.cart from : `"Cart"` to `"Cart!"`.
On the wire, this will be either null or an object. Clients using checks or even codegen may be currently supporting this as optional (i.e. with a Maybe(Cart)
type), but given that the format on the wire looks identical in the required case, I think it's fully backwards compatible.
Would be keen to understand if this is not backwards compatible in the general case, or get a fix out if it is.
Field type changed on field MarkAllIdeasAsSeenInput.ideaIds from :
"[ID!]!"
to"[ID!]"
.
I just got this output from some tooling that we use built around graphql-schema-utils
. To my understanding, an input field changing from required to not-required is a backwards compatible change, so this looks like a bug.
Could you confirm whether this is expected or not, am I missing details about backwards compatibility here?
Given that GraphQL's type/interface matching syntax provides powerful control over the format of returned data, I believe adding types to a GraphQL Union should be considered backwards compatible.
I could see the option for adding a strict mode where this case, and potentially also the addition of new values to enums, are considered backwards incompatible, but with the affordances given by GraphQL'- structure, semantics, and syntax, I believe the default behaviour here should be to be backwards compatible.
when merging, I got the problem. it seems other.getFields() has no Object.prototype. It works with replacing it with Object.prototype.hasOwnProperty.call(other.getFields(), key)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.