G.apex

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

Default Value Guide

Default Value

Define Default Values

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

For non-object types, we can specify the default value of the field if the fetched value is null.

Contribute on Github! Edit this section.