Skip to content

siriusastrebe/RecursiveGraphQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage:

node app.js

Open up http://localhost:4000/graphql. Query the users:

{
    user(id:1) {
        id
        name
        age
        children {
          id
          name
          age
          children {
            id
            name
            age
          }
        }
    }
}

You should get a recursive listing matching this structure:

{
  "data": {
    "user": {
      "id": 1,
      "name": "Brian",
      "age": 21,
      "children": [
        {
          "id": 3,
          "name": "Faith",
          "age": 23,
          "children": []
        }
      ]
    }
  }
}

Fully recursive queries are forbidden by GraphQL! See the discussion here:

graphql/graphql-spec#91 (comment)

About

A basic recursive structure in GraphQL and Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published