• 1Installation
  • 2Preliminary Knowledge
  • 3G.apex Demo
  • 4G.apex Query
  • 5Create Object Types
  • 6Create Schema
  • 7Resolver Functions
  • 8Serve Query Request
  • 9Mutation
  • 10Parameters
  • 11Default Value
  • 12Aliases
  • 13Fragments
  • 14Variables
  • 15Directives

G.apex

  • Docs
  • Tutorials
Getting started with G.apex

Default Value

We can specify the default values in G.apex query.

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

Here if the author of the book is not found, Unknown author will be returned as the default value.

Done