• 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

Create Object Types

To start with, we create some simple Object Types.

G.ObjectType bookType = new G.ObjectType('Book', 'Book__c')
    .addField('id', G.StringType, 'Id')
    .addField('name', G.StringType, 'Name');

Here we created an ObjectType of Book, bound to SObject type Book__c. The book type has two fields, id of String type and name of String type.

Done