Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork315
Live examples of schemas builded with graphql-compose
graphql-compose/graphql-compose-examples
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Live example on Heroku:https://graphql-compose.herokuapp.com/
yarn installyarn seed&& yarn devopen http://localhost:3000Thisexample has simple User mongoose model that supports bunch of CRUD operations.
constUserSchema=newmongoose.Schema({name:String,// standard typesage:{type:Number,index:true,},languages:{type:[LanguagesSchema],// you may include other schemas (here included as array of embedded documents)default:[],},contacts:{// another mongoose way for providing embedded documentsemail:String,phones:[String],// array of strings},gender:{// enum field with valuestype:String,enum:['male','female','ladyboy'],},});
Thisschema shows all available CRUD operations which are compatible with Relay. It usesgraphql-compose-mongose andgraphql-compose-relay:
composeWithRelay(RootQueryTC)addsnodefield to the RootQuery. ViaRootQuery.node(id)you may find objects by globally unique ID among all types.composeWithRelay(UserTC)- modifyUserTCgenerated bygraphql-compose-mongoose- adds
idfield with Relay's globally unique ID - this type will be added to
NodeInterfacefor resolving viaRootQuery.node - for mutations will be added
clientMutationIdto input and output objects types - also all arguments in mutations will be moved into
inputarg
- adds
This is a sample data of some trading company, which consists from 8 models. All models has cross-relations to each other. This schema used in the Relay example app:Server schema code,Client app code,Live demo of client.
Thisschema usesgraphql-compose-elasticsearch module and provides full API available in the official elasticsearch module.
About
Live examples of schemas builded with graphql-compose
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.




