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
Hi everyone!
I am using graphql-tools: ^4.0.3, graphql: ^14.0.2, apollo-server: ^2.1.0
This is the error I am having: [Error: "createUser" defined in resolvers, but not in schema]
This is the way I am creating my typeDefs:
import Scalars from "../scalars/scalars.graphql";
import Query from "../types/Query/Query.graphql";
import Mutation from "../types/Mutation/Mutation.graphql";
import Review from "./Review/ReviewSchema.graphql";
import ReviewQueries from "./Review/ReviewQueries.graphql";
import ReviewMutations from "./Review/ReviewMutations.graphql";
import UserMutations from "./User/UserMutations.graphql";
import User from "./User/UserSchema.graphql";
import UserQueries from "./User/UserQueries.graphql";
// Construct a schema, using GraphQL schema language
const typeDefs = [
Query,
Mutation,
User,
UserQueries,
UserMutations,
MongoResult,
Review,
ReviewQueries,
ReviewMutations,
Scalars
];
export default typeDefs;
This is how I am merging my resolvers:
import merge from "lodash/merge";
import Scalars from "./scalars/Scalars";
import Mutation from "./types/Mutation/Mutation";
import Query from "./types/Query/Query";
// Merge resolvers
const resolvers = merge(Mutation, Query, Scalars);
// Provide resolver functions for your schema fields
export default resolvers;
What am I missing?
These problems started when I started using these keywords:
This issue was not caused by graphql-tools, I tried to "recycle" the code created for User resolvers by copying and pasting to Review resolvers to make minor alterations after, but something must have been wrongly done and that error was thrown.
I have gone back using git (praised version control!) and now I'm doing everything step by step instead of trying to save time (which has instead wasted too much of it).
Sorry if this just ends up poluting this great project issues tab...
Hi everyone!
I am using graphql-tools: ^4.0.3, graphql: ^14.0.2, apollo-server: ^2.1.0
This is the error I am having:
[Error: "createUser" defined in resolvers, but not in schema]
This is the way I am creating my typeDefs:
This is how I am merging my resolvers:
What am I missing?
These problems started when I started using these keywords:
ReviewMutations.graphql:
ReviewQueries.graphql:
Same usage in UserQueries and UserMutation.
This is how I am creating the Apollo Server:
I've seen these issues:
apollographql/apollo-server#1158,
#750,
I've spent too much time trying to solve this issue to no avail, please help me!
If you need some more info please tell me ;)
Thanks in advance!
The text was updated successfully, but these errors were encountered: