You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of version 6.0.0, mergeSchemas appears to fail when merging schemas with custom scalars. I was able to reproduce the issue in this SO post. Here's a simplified reproduction:
const { mergeSchemas, makeExecutableSchema } = require("graphql-tools");
const GraphQLUUID = require('graphql-type-uuid')
const countrySchema = makeExecutableSchema({
typeDefs: `
scalar UUID
type Country {
id: UUID!
name: String
}
type Query {
country: Country
}
`,
resolvers: {
UUID: GraphQLUUID,
}
})
const citySchema = makeExecutableSchema({
typeDefs: `
scalar UUID
type City {
id: ID!
name: String
}
type Query {
city: City
}
`,
})
const schema = mergeSchemas({
schemas: [countrySchema, citySchema],
});
The resulting error:
RangeError: Maximum call stack size exceeded
at Function.assign (<anonymous>)
at Object.keys.forEach.key (.../node_modules/@graphql-tools/utils/index.cjs.js:2651:28)
at Array.forEach (<anonymous>)
at sources.forEach (.../node_modules/@graphql-tools/utils/index.cjs.js:2641:33)
at Array.forEach (<anonymous>)
at mergeDeep (.../node_modules/@graphql-tools/utils/index.cjs.js:2639:13)
at Object.keys.forEach.key (.../node_modules/@graphql-tools/utils/index.cjs.js:2647:39)
at Array.forEach (<anonymous>)
at sources.forEach (.../node_modules/@graphql-tools/utils/index.cjs.js:2641:33)
at Array.forEach (<anonymous>)
Bumping the version down to 5.0.0 fixes the issue. Removing the custom scalar also fixes the issue.
The text was updated successfully, but these errors were encountered:
As of version 6.0.0, mergeSchemas appears to fail when merging schemas with custom scalars. I was able to reproduce the issue in this SO post. Here's a simplified reproduction:
The resulting error:
Bumping the version down to 5.0.0 fixes the issue. Removing the custom scalar also fixes the issue.
The text was updated successfully, but these errors were encountered: