G.apex

  • Docs
  • Tutorials
Docs Menu
  • G.apex Core
    • Parameters
    • Default Value
    • Alias
    • Fragment
    • Variable
    • Directive
  • Editor
  • Methods
    • Global
    • Schema
    • Data Type
    • Resolver
    • Directive

Fragment Guide

Fragment

Use Fragments

{
    "query": {
        "book": {
            "@id": "2",
            "name": "",
            "...author": ""
        }
    },
    "...author": {
        "author": {
            "name": ""
        }
    }
}

We define fragments by prepending ... before the name and placing them at the root of the query. The result will be like:

{
    "query": {
        "book": {
            "author": {
                "name": "First Author"
            },
            "name": "Second Book"
        }
    }
}

Contribute on Github! Edit this section.