Closed mblode closed 6 years ago
Yeah! This threw me too when I was starting. You'll want to use the "extend" keyword for types that are defined in more than one file. Aka
extend type Mutation {
createProduct(product: ProductInput!): Product
}
Same goes for multiple Query defs.
I was getting a similar error, and fixed it with merge()
, as Scott mentioned in the YouTube comments:
const typeDefs = merge([QuerySchema, EntrySchema, UserSchema]);
I cannot realize the exact error. But i have this error "Type "Mutation" was defined more than once."
I'm trying to expand on the API structure by creating a folder for a list type. But when I create a new type Mutation and import it into register-api, I get this: "Error: Type 'Mutation' was defined more than once." How would you fix this?