MCPcopy Create free account
hub / github.com/artsy/force / getBreakingChanges

Function getBreakingChanges

scripts/validateSchemas.js:21–41  ·  view source on GitHub ↗
(metaphysicsEnv, metaphysicsVersion = 2)

Source from the content-addressed store, hash-verified

19}
20
21const getBreakingChanges = async (metaphysicsEnv, metaphysicsVersion = 2) => {
22 const localSchema = readFileSync(
23 path.join(__dirname, "../data/schema.graphql"),
24 {
25 encoding: "utf8",
26 }
27 )
28 const metaphysicsSchemaSuffix = metaphysicsVersion === 2 ? "V2" : ""
29 const metaphysicsRef = metaphysicsEnv == "production" ? "release" : "staging"
30 const metaphyicsSchema = await downloadMetaphysicsSchema(
31 `https://raw.githubusercontent.com/artsy/metaphysics/${metaphysicsRef}/_schema${metaphysicsSchemaSuffix}.graphql`
32 )
33
34 const allChanges = diff(
35 buildSchema(localSchema),
36 buildSchema(metaphyicsSchema)
37 )
38 const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
39 const messages = breakings.map(c => c.message)
40 return messages
41}
42
43module.exports = {
44 getBreakingChanges,

Callers 1

validateSchemas.jsFile · 0.85

Calls 1

Tested by

no test coverage detected