Simpl To GraphQL Schema
This is new updated and improved fork of # Simple Schema - GraphQL Schema Bridge except it doesn't build your resolvers.
Change only your Meteor Simple Schema: GraphQL schema are updated automatically.
Define your Simple Schemas for your collection and let
simpl-to-graphql-schema
do the tedious work of defining the schema's basic fields and resolvers, for you.
This tool works with Meteor Framework.
- Installation
npm install --save simpl-to-graphql-schema
- Your simple schema
;; // Define your collectionconst Items = 'items'; //build your schema with SimpleSchema as usualconst Schemas = _id: type: String name: type: String label: "Item name" ownerId: type: String label: "Owner identification" createdAt: type: String label: "Item creation date" updatedAt: type: String label: "Item last update" ; ;Items;
- Your GraphQL schema
;; const schemaGql = SimpleToGraphql;;
- Your resolvers
//in case your want to use the built in Date scalar;// collections Query: Items Items // you can put it here or in your merge of resolvers with DateScalar Date: DateScalarDate ;