Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const generateTypeDefs = () => {
const typesArray = fileLoader(join(__dirname, './**/!(generated)/*.graphql'));
const typeDefs = `
# import * from "prisma.graphql"
scalar Upload
scalar DateTime
${FieldValidationError}
${MutationValidationError}
${mergeTypes(typesArray, { all: true })}
`;
writeFileSync(join(__dirname, 'generated', 'schema.graphql'), typeDefs);
};
import path from 'path';
import { fileLoader, mergeResolvers, mergeTypes } from 'merge-graphql-schemas';
import { makeExecutableSchema } from 'graphql-tools';
const resolversArray = fileLoader(path.join(__dirname, './**/*.resolvers.*'));
const typesArray = fileLoader(path.join(__dirname, './**/*.graphql'));
const resolvers = mergeResolvers(resolversArray);
const typeDefs = mergeTypes(typesArray);
const schema = makeExecutableSchema({ typeDefs, resolvers });
export { schema, resolvers };
import path from 'path'
import { fileLoader, mergeTypes } from 'merge-graphql-schemas'
const typesArray = fileLoader(path.join(__dirname, './'), { recursive: true })
export default mergeTypes(typesArray, { all: true })
import path from "path";
import { makeExecutableSchema } from 'graphql-tools';
import { fileLoader, mergeTypes, mergeResolvers } from 'merge-graphql-schemas';
const typesArray = fileLoader(path.join(__dirname, '../types'), { recursive: true });
const resolversArray = fileLoader(path.join(__dirname, '../resolvers'));
const allTypes = mergeTypes(typesArray);
const allResolvers = mergeResolvers(resolversArray);
const schema = makeExecutableSchema({
typeDefs: allTypes,
resolvers: allResolvers
});
export default schema;
import path from 'path';
import { makeExecutableSchema } from 'graphql-tools';
import { fileLoader, mergeResolvers, mergeTypes } from 'merge-graphql-schemas';
const allTypes = fileLoader(path.join(__dirname, 'api/**/*.graphql'));
const allResolvers = fileLoader(path.join(__dirname, 'api/**/*.js'));
const schema = makeExecutableSchema({
typeDefs: mergeTypes(allTypes),
resolvers: mergeResolvers(allResolvers),
});
export default schema;