graphql-schema-server
v1.0.1
Published
this package is used to split the graphql schema logic for typeDefs and resolvers
Downloads
2
Readme
Example
import serverOptions from "graphql-schema-server";
const Schema = serverOptions();
const userType = ' type User { id: ID! name: String! email: String! }`;
const userQuery = ` user: User! `;
Schema.setTypeDefsTypes([userType]).setTypeDefsQueries([userQuery]);
const userResolver = { user(){ return { id: "1-2", name: "Mahmoud", email: "[email protected]" }; } };
Schema.setResolversQueries([userResolver]);
const schema = Schema.build();
console.log(schema);