I am working on an app that is operating fine with 14.6.0, but throws an error message when upgrading graphql to 15.0.0. Before getting to the error message, let's walk through the configuration:
Here's how I'm initializing the app:
export default new ApolloServer({
schema: makeExecutableSchema({
typeDefs,
resolvers: merge(...resolverObjects),
})
});
...where:
typeDefsis an array made up of the plaintext content of.graphqlfiles read from the disk (the app is doing different things so I've logically separated the schema into multiple files).mergeis thelodashfunction that does a deep merge on allresolverObjects.
The first schema in typeDefs is a dummy "base" schema:
type Query {
_dummy: String
}
type Mutation {
_dummy: String
}
All the subsequent schemas define new object types and extend the Query and/or Mutation schemas:
extend type Query {
readStuff: String!
}
extend type Mutation {
saveStuff: Boolean!
}
In 14.6.0, this setup works fine.
Upgrading to 15.0.0 produces the following error, for every new property of the extended Query and Mutation types:
Field "[...]" already exists in the schema. It cannot also be defined in this type extension.
But it does not already exist. It's only defined in type extensions. What's the problem?