Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Live examples of schemas builded with graphql-compose

NotificationsYou must be signed in to change notification settings

graphql-compose/graphql-compose-examples

Repository files navigation

Travis

Live example on Heroku:https://graphql-compose.herokuapp.com/

yarn installyarn seed&& yarn devopen http://localhost:3000

User: simple schema with one type

Thisexample 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'],},});

screen shot 2016-07-03 at 15 23 03

screen shot 2016-07-15 at 12 41 17

User for Relay: simple schema with one type

Thisschema shows all available CRUD operations which are compatible with Relay. It usesgraphql-compose-mongose andgraphql-compose-relay:

  • composeWithRelay(RootQueryTC) addsnode field to the RootQuery. ViaRootQuery.node(id) you may find objects by globally unique ID among all types.
  • composeWithRelay(UserTC) - modifyUserTC generated bygraphql-compose-mongoose
    • addsid field with Relay's globally unique ID
    • this type will be added toNodeInterface for resolving viaRootQuery.node
    • for mutations will be addedclientMutationId to input and output objects types
    • also all arguments in mutations will be moved intoinput arg

screen shot 2017-03-13 at 10 20 34

Northwind: complex schema with 8 models 🌶🌶🌶

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.

relay-northwind-app

Elasticsearch REST API wrapper

Thisschema usesgraphql-compose-elasticsearch module and provides full API available in the official elasticsearch module.

screen shot 2017-03-07 at 22 26 17

About

Live examples of schemas builded with graphql-compose

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp