<file_sep>import { gql } from "apollo-server-express";
import { makeExecutableSchema } from "graphql-tools";
import Hello from "graphql/Hello";

import { merge } from "lodash";

const Query = gql`
  type Query {
    _empty: String
  }
`;

const Mutation = gql`
  type Mutation {
    _empty: String
  }
`;

const getTypes = () =>
  Object.values({
    Query,
    Mutation,
    ...Hello.getTypes(),
  });

const getResolvers = () => merge(Hello.getResolvers());

const schema = makeExecutableSchema({
  typeDefs: getTypes(),
  resolvers: getResolvers(),
});

export default schema;
<file_sep># GraphQL Easy Starter
## By EasyCoders
[EasyCoders.io](https://easycoders.io)<file_sep>import getResolvers from "./resolvers";
import getTypes from "./type";

export default { getTypes, getResolvers };
<file_sep>import { gql } from "apollo-server-express";

const Hello = gql`
  extend type Query {
    hello: Hello
  }

  type Hello {
    message: String
  }
`;

const getTypes = () => ({ Hello });

export default getTypes;
<file_sep>import { IResolvers } from "apollo-server-express";

const resolvers = {
  Query: {
    hello: () => ({
      message: () => "Hello World!",
    }),
  },
};

const getResolvers = () =>
  ({
    ...resolvers,
  } as IResolvers);

export default getResolvers;
