G.apex

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

Data Type Guide

Data Type

Data Types

NameUsage
BooleanG.BooleanType
IntegerG.IntegerType
LongG.LongType
DoubleG.DoubleType
StringG.StringType
Listnew G.ListType(G.DataType)
Mapnew G.MapType(G.DataType)
Objectnew G.ObjectType(String) / new G.ObjectType(String, String)
Referencenew G.ReferenceType(String)

Data Type Methods

All data types have the following methods:

MethodDescription
String getType()Get the type name

List Type Methods

MethodDescription
G.DataType getElementType()Get element data type

Object Type Methods

MethodDescription
String getName()Get the name of the object type
String getSObjectType()Get the bound SObject type
ObjectType addField(String, DataType, Func, Boolean, String)Add field with name, type, resolver, resolver batch, and sobject type
ObjectType addField(String, DataType, Func, Boolean)Add field with name, type, resolver, resolver batch
ObjectType addField(String, DataType, Func)Add field with name, type, resolver
ObjectType addField(String, DataType, BatchResolver)Add field with name, type, resolver
ObjectType addField(String, DataType, Resolver)Add field with name, type, resolver
ObjectType addField(String, DataType, String)Add field with name, type, sobject type
ObjectType addField(String, DataType)Add field with name, type
ObjectType addParam(String, String, DataType, Func)Add a param with the field name, param name, type, validate func
ObjectType addParam(String, String, DataType)Add a param with the field name, param name, type
Map getSObjectFieldMapping()Get the sobject field mapping
Map describe()Describe the object type

Reference Type Methods

MethodDescription
String getName()Get the name of the object type
ObjectType getReferencedType()Get the referenced object type

Map Type Methods

Map type receives the element type as the type of the value and its key type is always String.

MethodDescription
G.DataType getElementType()Get element data type

Contribute on Github! Edit this section.