decorators

decorators

Methods

(static) .AdjacentSchema(object, property, descriptor)

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
object mixed

the object on which to apply the decorator

property String

the name of the object or property to
which the decorator is being applied.

descriptor Object

a standard Object.defineProperty style
descriptor object.

Since:
2.1.0
Source:
decorators/AdjacentSchema.js, line 26

(static) .FileSchema(path, extension) → {mixed}

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
path String

a relative or absolute path to the file containing
your GraphQL IDL schema portion for your object type.

extension String

the extension of the graphql schema file pointed
to in the previous parameter. By default these are ".graphql" but should
your path point to a file with a different extension, you should specify
that extension here.

Returns:
( mixed )

as per all class decorators, FileSchema returns the
class object being modified

Since:
2.3.0
Source:
decorators/FileSchema.js, line 26

(static) .Schema(schemaString)

This decorator allows you to specify the SCHEMA getter and associated
string as a parameter to the decorator itself. So, for example:

Parameters:
Name Type Description
schemaString String

a GraphQL IDL compliant string for defining a
GraphQL Object Schema.

Since:
2.2.0
Source:
decorators/Schema.js, line 18

(static) ⌾⠀extractBits(property) → {Object}

For each of the decorators, Getters, Setters, and Properties, we take a
list of property names used to create the appropriate accessor types. In
some cases, however, the instance of GQLBase's data model may have a
different name. Finally if the return type for the getter should be wrapped
in a another GQLBase class type, we will need a way to specify those things
too.

The extractBits() takes a single argument value from the decorator as it
parses them and converts it into an object, properly sorted, into values that
allow the above described behavior.

Examples:

```
// Create a class with a name and age property that map directly to the
// underlying data model

Parameters:
Name Type Description
property String | Array.<(String|function())>

name of a property, or list
of property names and a Class.

Returns:
( Object )

an object with the following format { typePropertyName: name of root instance property to create modelPropertyName: name of its associated internal model property typeClass: an optional class to wrap around the results in a getter }

Since:
2.5
Source:
decorators/ModelProperties.js, line 27

(static) .🏷⠀Getters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method.s

Source:
decorators/ModelProperties.js, line 149

(static) .🏷⠀Properties(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

This method creates both getters and setters

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters and setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 265

(static) .🏷⠀Setters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the setters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which setters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has
'name' and 'age' as properties, then passing those two strings will
result in setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 208

decorators

Methods

(static) .AdjacentSchema(object, property, descriptor)

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
object mixed

the object on which to apply the decorator

property String

the name of the object or property to
which the decorator is being applied.

descriptor Object

a standard Object.defineProperty style
descriptor object.

Since:
2.1.0
Source:
decorators/AdjacentSchema.js, line 26

(static) .FileSchema(path, extension) → {mixed}

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
path String

a relative or absolute path to the file containing
your GraphQL IDL schema portion for your object type.

extension String

the extension of the graphql schema file pointed
to in the previous parameter. By default these are ".graphql" but should
your path point to a file with a different extension, you should specify
that extension here.

Returns:
( mixed )

as per all class decorators, FileSchema returns the
class object being modified

Since:
2.3.0
Source:
decorators/FileSchema.js, line 26

(static) .Schema(schemaString)

This decorator allows you to specify the SCHEMA getter and associated
string as a parameter to the decorator itself. So, for example:

Parameters:
Name Type Description
schemaString String

a GraphQL IDL compliant string for defining a
GraphQL Object Schema.

Since:
2.2.0
Source:
decorators/Schema.js, line 18

(static) ⌾⠀extractBits(property) → {Object}

For each of the decorators, Getters, Setters, and Properties, we take a
list of property names used to create the appropriate accessor types. In
some cases, however, the instance of GQLBase's data model may have a
different name. Finally if the return type for the getter should be wrapped
in a another GQLBase class type, we will need a way to specify those things
too.

The extractBits() takes a single argument value from the decorator as it
parses them and converts it into an object, properly sorted, into values that
allow the above described behavior.

Examples:

```
// Create a class with a name and age property that map directly to the
// underlying data model

Parameters:
Name Type Description
property String | Array.<(String|function())>

name of a property, or list
of property names and a Class.

Returns:
( Object )

an object with the following format { typePropertyName: name of root instance property to create modelPropertyName: name of its associated internal model property typeClass: an optional class to wrap around the results in a getter }

Since:
2.5
Source:
decorators/ModelProperties.js, line 27

(static) .🏷⠀Getters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method.s

Source:
decorators/ModelProperties.js, line 149

(static) .🏷⠀Properties(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

This method creates both getters and setters

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters and setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 265

(static) .🏷⠀Setters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the setters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which setters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has
'name' and 'age' as properties, then passing those two strings will
result in setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 208

decorators

Methods

(static) .AdjacentSchema(object, property, descriptor)

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
object mixed

the object on which to apply the decorator

property String

the name of the object or property to
which the decorator is being applied.

descriptor Object

a standard Object.defineProperty style
descriptor object.

Since:
2.1.0
Source:
decorators/AdjacentSchema.js, line 26

(static) .FileSchema(path, extension) → {mixed}

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
path String

a relative or absolute path to the file containing
your GraphQL IDL schema portion for your object type.

extension String

the extension of the graphql schema file pointed
to in the previous parameter. By default these are ".graphql" but should
your path point to a file with a different extension, you should specify
that extension here.

Returns:
( mixed )

as per all class decorators, FileSchema returns the
class object being modified

Since:
2.3.0
Source:
decorators/FileSchema.js, line 26

(static) .Schema(schemaString)

This decorator allows you to specify the SCHEMA getter and associated
string as a parameter to the decorator itself. So, for example:

Parameters:
Name Type Description
schemaString String

a GraphQL IDL compliant string for defining a
GraphQL Object Schema.

Since:
2.2.0
Source:
decorators/Schema.js, line 18

(static) ⌾⠀extractBits(property) → {Object}

For each of the decorators, Getters, Setters, and Properties, we take a
list of property names used to create the appropriate accessor types. In
some cases, however, the instance of GQLBase's data model may have a
different name. Finally if the return type for the getter should be wrapped
in a another GQLBase class type, we will need a way to specify those things
too.

The extractBits() takes a single argument value from the decorator as it
parses them and converts it into an object, properly sorted, into values that
allow the above described behavior.

Examples:

```
// Create a class with a name and age property that map directly to the
// underlying data model

Parameters:
Name Type Description
property String | Array.<(String|function())>

name of a property, or list
of property names and a Class.

Returns:
( Object )

an object with the following format { typePropertyName: name of root instance property to create modelPropertyName: name of its associated internal model property typeClass: an optional class to wrap around the results in a getter }

Since:
2.5
Source:
decorators/ModelProperties.js, line 27

(static) .🏷⠀Getters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method.s

Source:
decorators/ModelProperties.js, line 149

(static) .🏷⠀Properties(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

This method creates both getters and setters

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters and setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 265

(static) .🏷⠀Setters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the setters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which setters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has
'name' and 'age' as properties, then passing those two strings will
result in setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 208

decorators

Methods

(static) .AdjacentSchema(object, property, descriptor)

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
object mixed

the object on which to apply the decorator

property String

the name of the object or property to
which the decorator is being applied.

descriptor Object

a standard Object.defineProperty style
descriptor object.

Since:
2.1.0
Source:
decorators/AdjacentSchema.js, line 26

(static) .FileSchema(path, extension) → {mixed}

A decorator that does three things. First it defines the
module() static method that is required when using adjacent
schema files. Secondly, it defines a SCHEMA getter that
returns GQLBase.ADJACENT_FILE. Finally it sets a static
getter with the Symbol, @adjacentSchema so that other
can determine whether or not the decorator was used.

Parameters:
Name Type Description
path String

a relative or absolute path to the file containing
your GraphQL IDL schema portion for your object type.

extension String

the extension of the graphql schema file pointed
to in the previous parameter. By default these are ".graphql" but should
your path point to a file with a different extension, you should specify
that extension here.

Returns:
( mixed )

as per all class decorators, FileSchema returns the
class object being modified

Since:
2.3.0
Source:
decorators/FileSchema.js, line 26

(static) .Schema(schemaString)

This decorator allows you to specify the SCHEMA getter and associated
string as a parameter to the decorator itself. So, for example:

Parameters:
Name Type Description
schemaString String

a GraphQL IDL compliant string for defining a
GraphQL Object Schema.

Since:
2.2.0
Source:
decorators/Schema.js, line 18

(static) ⌾⠀extractBits(property) → {Object}

For each of the decorators, Getters, Setters, and Properties, we take a
list of property names used to create the appropriate accessor types. In
some cases, however, the instance of GQLBase's data model may have a
different name. Finally if the return type for the getter should be wrapped
in a another GQLBase class type, we will need a way to specify those things
too.

The extractBits() takes a single argument value from the decorator as it
parses them and converts it into an object, properly sorted, into values that
allow the above described behavior.

Examples:

```
// Create a class with a name and age property that map directly to the
// underlying data model

Parameters:
Name Type Description
property String | Array.<(String|function())>

name of a property, or list
of property names and a Class.

Returns:
( Object )

an object with the following format { typePropertyName: name of root instance property to create modelPropertyName: name of its associated internal model property typeClass: an optional class to wrap around the results in a getter }

Since:
2.5
Source:
decorators/ModelProperties.js, line 27

(static) .🏷⠀Getters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method.s

Source:
decorators/ModelProperties.js, line 149

(static) .🏷⠀Properties(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the getters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which getters should be injected.

This method creates both getters and setters

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has 'name'
and 'age' as properties, then passing those two strings will result
in getters and setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 265

(static) .🏷⠀Setters(propertyNames) → {function}

When working with GQLBase instances that expose properties
that have a 1:1 mapping to their own model property of the
same name, adding the setters manually can be annoying. This
takes an indeterminate amount of strings representing the
properties for which setters should be injected.

Parameters:
Name Type Description
propertyNames Array.<(String|Array.<String>)>

if the model has
'name' and 'age' as properties, then passing those two strings will
result in setters that surface those properties as GraphQL fields.

Returns:
( function )

a class decorator method

Since:
2.1.0
Source:
decorators/ModelProperties.js, line 208

graphql-lattice docs generated by JSDoc 3.4.3 on Wed Aug 09 2017 using the Kitsune theme.