GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - johnaco/graphql-compose-examples: Live examples of schemas builded with graphql-compose

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

165 Commits
165 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
flow-typed/npm
flow-typed/npm
 
 
scripts
scripts
 
 
.babelrc
.babelrc
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.js
.eslintrc.js
 
 
.flowconfig
.flowconfig
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
README.md
README.md
 
 
config.js
config.js
 
 
index.js
index.js
 
 
mainPage.js
mainPage.js
 
 
mongooseConnection.js
mongooseConnection.js
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

This is example app of graphql-compose

Travis

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

npm install
npm run seed && npm run start:watch
open http://localhost:3000

User: simple schema with one type

This example has simple User mongoose model that supports bunch of CRUD operations.

const UserSchema = new mongoose.Schema({
  name: String, // standard types
  age: {
    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 documents
    email: String,
    phones: [String], // array of strings
  },
  gender: { // enum field with values
    type: 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

This schema shows all available CRUD operations which are compatible with Relay. It uses graphql-compose-mongose and graphql-compose-relay:

  • composeWithRelay(RootQueryTC) adds node field to the RootQuery. Via RootQuery.node(id) you may find objects by globally unique ID among all types.
  • composeWithRelay(UserTC) - modify UserTC generated by graphql-compose-mongoose
    • adds id field with Relay's globally unique ID
    • this type will be added to NodeInterface for resolving via RootQuery.node
    • for mutations will be added clientMutationId to input and output objects types
    • also all arguments in mutations will be moved into input 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

This schema uses graphql-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

graphql-compose.herokuapp.com/

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.