graphql-constraint-directive icon indicating copy to clipboard operation
graphql-constraint-directive copied to clipboard

Getting "Couldn't find type constraint in any of the schemas." error

Open mpiorowski opened this issue 3 years ago • 0 comments

I use graphql-tools to load up multiple files into one schema. Maybe i should set it up diffrently? Pls help :)

const loadSchema = loadSchemaSync(join(__dirname, "./graphql/*.graphql"), {
  loaders: [new GraphQLFileLoader()],
});

let schema = makeExecutableSchema({
  typeDefs: [constraintDirectiveTypeDefs, loadSchema],
});
schema = constraintDirective()(schema);

app.register(mercurius, {
  schema: schema,
  resolvers,
  loaders,
  context: buildContext,
  graphiql: true,
});

mpiorowski avatar Feb 02 '22 07:02 mpiorowski