1 | <!DOCTYPE html>
|
2 | <html lang="en">
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <meta name="viewport" content="width=device-width,initial-scale=1">
|
6 | <title>decorators - Documentation</title>
|
7 |
|
8 | <script src="scripts/prettify/prettify.js"></script>
|
9 | <script src="scripts/prettify/lang-css.js"></script>
|
10 | |
11 |
|
12 |
|
13 | <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
14 | <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
15 | <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
16 | </head>
|
17 | <body>
|
18 |
|
19 | <input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
20 | <label for="nav-trigger" class="navicon-button x">
|
21 | <div class="navicon"></div>
|
22 | </label>
|
23 |
|
24 | <label for="nav-trigger" class="overlay"></label>
|
25 |
|
26 | <nav>
|
27 | <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="AwaitingPromiseError.html">AwaitingPromiseError</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="AwaitingPromiseError.html#%25E2%258C%25BE%25E2%25A0%2580asyncFn">⌾⠀asyncFn</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="AwaitingPromiseError.html#%25E2%258C%25BE%25E2%25A0%2580setPromise">⌾⠀setPromise</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="AwaitingPromiseError_exports.AwaitingPromiseError.html">AwaitingPromiseError</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="AwaitingPromiseError_exports.AwaitingPromiseError.html#setPromise">setPromise</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Deferred_exports.Deferred.html">Deferred</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DirectTypeAdd.html">DirectTypeAdd</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="FunctionExecutionError_FunctionExecutionError.html">FunctionExecutionError</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLBase.html">GQLBase</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.apiDocs">apiDocs</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580getMergedRoot">⌾⠀getMergedRoot</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580getProp">⌾⠀getProp</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580getResolver">⌾⠀getResolver</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580IDLFilePath">⌾⠀IDLFilePath</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580MUTATORS">⌾⠀MUTATORS</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580RESOLVERS">⌾⠀RESOLVERS</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%258C%25BE%25E2%25A0%2580setupModel">⌾⠀setupModel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580handler">⬇︎⠀handler</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580SCHEMA">⬇︎⠀SCHEMA</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580applyAutoProps">⌾⠀applyAutoProps</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580callProp">⌾⠀callProp</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580extendModel">⌾⠀extendModel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580getModel">⌾⠀getModel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580getProp">⌾⠀getProp</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580getResolver">⌾⠀getResolver</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%258C%25BE%25E2%25A0%2580setModel">⌾⠀setModel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%25AC%2586%25EF%25B8%258E%25E2%25A0%2580requestData">⬆︎⠀requestData</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580requestData">⬇︎⠀requestData</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#~deleteProperty">deleteProperty</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBase.html#~set">set</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLBase.%25E2%258E%2586%25E2%25A0%2580constructor.html">⎆⠀constructor</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLEnum.html">GQLEnum</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#..get">.get</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#..set">.set</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#.valueFor">valueFor</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580enums">⬇︎⠀enums</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580name">⬇︎⠀name</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580value">⬇︎⠀value</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#.%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580values">⬇︎⠀values</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLEnum.html#GenerateEnumsProxyHandler">GenerateEnumsProxyHandler</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html">GQLExpressMiddleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#.clearCache">clearCache</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#.%25E2%258C%25BE%25E2%25A0%2580generateSchemaSDL">⌾⠀generateSchemaSDL</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#astMiddleware">astMiddleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#schemaMiddleware">schemaMiddleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#%25E2%258C%25BE%25E2%25A0%2580customMiddleware">⌾⠀customMiddleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580middleware">⬇︎⠀middleware</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580middlewareWithoutGraphiQL">⬇︎⠀middlewareWithoutGraphiQL</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLExpressMiddleware.html#%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580schema">⬇︎⠀schema</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLExpressMiddleware.%25E2%258E%2586%25E2%25A0%2580constructor.html">⎆⠀constructor</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLInterface.html">GQLInterface</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLInterface.html#.%25E2%258C%25BE%25E2%25A0%2580resolveType">⌾⠀resolveType</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="GQLScalar.html">GQLScalar</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLScalar.html#.parseLiteral">parseLiteral</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLScalar.html#.parseValue">parseValue</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLScalar.html#.serialize">serialize</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="IDLFileHandler.html">IDLFileHandler</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="IDLFileHandler.html#%25E2%258C%25BE%25E2%25A0%2580getFile">⌾⠀getFile</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="IDLFileHandler.html#%25E2%258C%25BE%25E2%25A0%2580getSchema">⌾⠀getSchema</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="IDLFileHandler.html#%25E2%258C%25BE%25E2%25A0%2580getSyntaxTree">⌾⠀getSyntaxTree</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="IDLFileHandler.%25E2%258E%2586%25E2%25A0%2580constructor.html">⎆⠀constructor</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="ModuleParser.html">ModuleParser</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#.%25E2%258C%25BE%25E2%25A0%2580arrayToPattern">⌾⠀arrayToPattern</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#.%25E2%258C%25BE%25E2%25A0%2580checkForPackageExtensions">⌾⠀checkForPackageExtensions</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#%25E2%258C%25BE%25E2%25A0%2580findGQLBaseClasses">⌾⠀findGQLBaseClasses</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#%25E2%258C%25BE%25E2%25A0%2580importClass">⌾⠀importClass</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#%25E2%258C%25BE%25E2%25A0%2580parse">⌾⠀parse</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#%25E2%258C%25BE%25E2%25A0%2580parseSync">⌾⠀parseSync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#~%25E2%258C%25BE%25E2%25A0%2580walk">⌾⠀walk</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#~%25E2%258C%25BE%25E2%25A0%2580walkSync">⌾⠀walkSync</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="ModuleParser.html#~%25E2%258E%2586%25E2%25A0%2580constructor">⎆⠀constructor</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="ModuleParser.exports.ModuleParser.html">exports.ModuleParser</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="SchemaUtils.html">SchemaUtils</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SchemaUtils.html#.%25E2%258C%25BE%25E2%25A0%2580createMergedRoot">⌾⠀createMergedRoot</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SchemaUtils.html#.%25E2%258C%25BE%25E2%25A0%2580injectComments">⌾⠀injectComments</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SchemaUtils.html#.%25E2%258C%25BE%25E2%25A0%2580injectEnums">⌾⠀injectEnums</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SchemaUtils.html#.%25E2%258C%25BE%25E2%25A0%2580injectInterfaceResolvers">⌾⠀injectInterfaceResolvers</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SchemaUtils.html#.%25E2%258C%25BE%25E2%25A0%2580injectScalars">⌾⠀injectScalars</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="SyntaxTree.html">SyntaxTree</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580EmptyDocument">⌾⠀EmptyDocument</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580EmptyMutation">⌾⠀EmptyMutation</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580EmptyQuery">⌾⠀EmptyQuery</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580findDefinition">⌾⠀findDefinition</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580findField">⌾⠀findField</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580findInASTArrayByNameValue">⌾⠀findInASTArrayByNameValue</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580from">⌾⠀from</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580fromAST">⌾⠀fromAST</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258C%25BE%25E2%25A0%2580fromSchema">⌾⠀fromSchema</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#.%25E2%258E%2586%25E2%25A0%2580constructor">⎆⠀constructor</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580appendDefinitions">⌾⠀appendDefinitions</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580consumeDefinition">⌾⠀consumeDefinition</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580find">⌾⠀find</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580findEnumDefinition">⌾⠀findEnumDefinition</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580setAST">⌾⠀setAST</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580toString">⌾⠀toString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%258C%25BE%25E2%25A0%2580updateAST">⌾⠀updateAST</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%25AC%2586%25EF%25B8%258E%25E2%25A0%2580ast">⬆︎⠀ast</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SyntaxTree.html#%25E2%25AC%2587%25EF%25B8%258E%25E2%25A0%2580ast">⬇︎⠀ast</a></span></li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="utils.Deferred.html">Deferred</a></span></li><li class="nav-heading">Namespaces</li><li class="nav-heading"><span class="nav-item-type type-namespace">N</span><span class="nav-item-name"><a href="decorators.html">decorators</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#.%25E2%258C%25BE%25E2%25A0%2580extractBits">⌾⠀extractBits</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580AdjacentSchema">.🏷⠀AdjacentSchema</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580FileSchema">.🏷⠀FileSchema</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580Getters">.🏷⠀Getters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580Properties">.🏷⠀Properties</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580Schema">.🏷⠀Schema</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#..%25F0%259F%258F%25B7%25E2%25A0%2580Setters">.🏷⠀Setters</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="decorators.html#~decorate">decorate</a></span></li><li class="nav-heading"><span class="nav-item-type type-namespace">N</span><span class="nav-item-name"><a href="GQLBaseEnv.html">GQLBaseEnv</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="GQLBaseEnv.html#~notDefined">notDefined</a></span></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#applyTags">applyTags</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#AsyncFunctionExecutionError">AsyncFunctionExecutionError</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#CHECK_API_DOCS">CHECK_API_DOCS</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#CHECK_RESOLVERS">CHECK_RESOLVERS</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#CHECK_SCHEMA">CHECK_SCHEMA</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#CHECKLIST">CHECKLIST</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#FunctionExecutionError">FunctionExecutionError</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#getChecklist">getChecklist</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#hasChecklist">hasChecklist</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#newChecklist">newChecklist</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#setChecklist">setChecklist</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#types">types</a></span></li>
|
28 | </nav>
|
29 |
|
30 | <div id="main">
|
31 |
|
32 | <h1 class="page-title">decorators</h1>
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | <section>
|
41 |
|
42 | <header>
|
43 |
|
44 | <h2>
|
45 | decorators
|
46 | </h2>
|
47 |
|
48 |
|
49 | </header>
|
50 |
|
51 | <article>
|
52 | <div class="container-overview">
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | <dl class="details">
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | <dt class="tag-source">Source:</dt>
|
87 | <dd class="tag-source"><ul class="dummy"><li>
|
88 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line232">line 232</a>
|
89 | </li></ul></dd>
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | </dl>
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | </div>
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | <h3 class="subsection-title">Members</h3>
|
116 |
|
117 |
|
118 |
|
119 | <div class="section-members">
|
120 | <h4 class="name" id=".DirectTypeManager"><span class="type-signature">(static, constant) </span>DirectTypeManager<span class="type-signature"> :Object</span></h4>
|
121 |
|
122 |
|
123 |
|
124 |
|
125 | <div class="description">
|
126 | <p>A small suite of functions a getter that allows easy manipulation of the<br>the DIRECT_TYPES workaround needed for some types of complex class<br>wrapping allowed by the @Getters and @Properties decorators. Namely the<br>ability to do something like @Getters('name', String) which would wrap the<br>contents of whatever is in the objects model in a String call.</p>
|
127 | <p>Direct types are those that need to be called without <code>new</code> in order for the<br>desired behavior to present itself.</p>
|
128 | </div>
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | <dl class="details">
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | <dt class="tag-since">Since:</dt>
|
140 | <dd class="tag-since"><ul class="dummy"><li>2.7.0</li></ul></dd>
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | <dt class="tag-source">Source:</dt>
|
165 | <dd class="tag-source"><ul class="dummy"><li>
|
166 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line214">line 214</a>
|
167 | </li></ul></dd>
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 | </dl>
|
176 |
|
177 |
|
178 |
|
179 | <h5>Type:</h5>
|
180 | <ul>
|
181 | <li>
|
182 |
|
183 | <span class="param-type"><code>Object</code></span>
|
184 |
|
185 |
|
186 | </li>
|
187 | </ul>
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 | </div>
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 | <h3 class="subsection-title">Methods</h3>
|
200 |
|
201 |
|
202 |
|
203 | <div class="section-method">
|
204 |
|
205 |
|
206 |
|
207 | <h4 class="name" id=".%E2%8C%BE%E2%A0%80extractBits"><span class="type-signature">(static) </span>⌾⠀extractBits<span class="signature">(property)</span><span class="type-signature"> → {Object}</span></h4>
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 | <div class="description">
|
214 | <p>For each of the decorators, Getters, Setters, and Properties, we take a<br>list of property names used to create the appropriate accessor types. In<br>some cases, however, the instance of GQLBase's data model may have a<br>different name. Finally if the return type for the getter should be wrapped<br>in a another GQLBase class type, we will need a way to specify those things<br>too.</p>
|
215 | <p>The <code>extractBits()</code> takes a single argument value from the decorator as it<br>parses them and converts it into an object, properly sorted, into values that<br>allow the above described behavior.</p>
|
216 | <p>Examples:</p>
|
217 | <p>```<br>// Create a class with a name and age property that map directly to the<br>// underlying data model</p>
|
218 | </div>
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | <dl class="details">
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | <dt class="tag-since">Since:</dt>
|
230 | <dd class="tag-since"><ul class="dummy"><li>2.5</li></ul></dd>
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 | <dt class="tag-source">Source:</dt>
|
255 | <dd class="tag-source"><ul class="dummy"><li>
|
256 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line11">line 11</a>
|
257 | </li></ul></dd>
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 | </dl>
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 | <h5>Parameters:</h5>
|
276 |
|
277 |
|
278 | <table class="params">
|
279 | <thead>
|
280 | <tr>
|
281 |
|
282 | <th>Name</th>
|
283 |
|
284 |
|
285 | <th>Type</th>
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 | <th class="last">Description</th>
|
292 | </tr>
|
293 | </thead>
|
294 |
|
295 | <tbody>
|
296 |
|
297 |
|
298 | <tr>
|
299 |
|
300 | <td class="name"><code>property</code></td>
|
301 |
|
302 |
|
303 | <td class="type">
|
304 |
|
305 |
|
306 | <span class="param-type"><code>String</code></span>
|
307 | |
|
308 |
|
309 | <span class="param-type"><code>Array.<(String|function())></code></span>
|
310 |
|
311 |
|
312 |
|
313 | </td>
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 | <td class="description last">
|
320 | <p>name of a property, or list<br>of property names and a Class.</p>
|
321 |
|
322 | </td>
|
323 | </tr>
|
324 |
|
325 |
|
326 | </tbody>
|
327 | </table>
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 | <div class="section-returns">
|
343 | <h5>Returns:</h5>
|
344 |
|
345 |
|
346 |
|
347 | <dl class="param-type">
|
348 | <dt>
|
349 | Type:
|
350 | </dt>
|
351 | <dd>
|
352 |
|
353 | <span class="param-type"><code>Object</code></span>
|
354 |
|
355 |
|
356 | </dd>
|
357 | </dl>
|
358 |
|
359 |
|
360 | <div class="param-desc">
|
361 | <p>an object with the following format <code>{
|
362 | fieldName: name of root instance property to create
|
363 | modelName: name of its associated internal model property
|
364 | typeClass: an optional class to wrap around the results in a getter
|
365 | }</code></p>
|
366 | </div>
|
367 |
|
368 |
|
369 | </div>
|
370 |
|
371 |
|
372 |
|
373 | </div>
|
374 |
|
375 |
|
376 | <div class="section-method">
|
377 |
|
378 |
|
379 |
|
380 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80AdjacentSchema"><span class="type-signature">(static) </span>.🏷⠀AdjacentSchema<span class="signature">(object, property, descriptor)</span><span class="type-signature"></span></h4>
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 | <div class="description">
|
387 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
388 | </div>
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 | <dl class="details">
|
395 |
|
396 |
|
397 |
|
398 |
|
399 | <dt class="tag-since">Since:</dt>
|
400 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 | <dt class="tag-source">Source:</dt>
|
425 | <dd class="tag-source"><ul class="dummy"><li>
|
426 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line6">line 6</a>
|
427 | </li></ul></dd>
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 | </dl>
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | <h5>Parameters:</h5>
|
446 |
|
447 |
|
448 | <table class="params">
|
449 | <thead>
|
450 | <tr>
|
451 |
|
452 | <th>Name</th>
|
453 |
|
454 |
|
455 | <th>Type</th>
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 | <th class="last">Description</th>
|
462 | </tr>
|
463 | </thead>
|
464 |
|
465 | <tbody>
|
466 |
|
467 |
|
468 | <tr>
|
469 |
|
470 | <td class="name"><code>object</code></td>
|
471 |
|
472 |
|
473 | <td class="type">
|
474 |
|
475 |
|
476 | <span class="param-type"><code>mixed</code></span>
|
477 |
|
478 |
|
479 |
|
480 | </td>
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 | <td class="description last">
|
487 | <p>the object on which to apply the decorator</p>
|
488 |
|
489 | </td>
|
490 | </tr>
|
491 |
|
492 |
|
493 |
|
494 | <tr>
|
495 |
|
496 | <td class="name"><code>property</code></td>
|
497 |
|
498 |
|
499 | <td class="type">
|
500 |
|
501 |
|
502 | <span class="param-type"><code>String</code></span>
|
503 |
|
504 |
|
505 |
|
506 | </td>
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 | <td class="description last">
|
513 | <p>the name of the object or property to<br>which the decorator is being applied.</p>
|
514 |
|
515 | </td>
|
516 | </tr>
|
517 |
|
518 |
|
519 |
|
520 | <tr>
|
521 |
|
522 | <td class="name"><code>descriptor</code></td>
|
523 |
|
524 |
|
525 | <td class="type">
|
526 |
|
527 |
|
528 | <span class="param-type"><code>Object</code></span>
|
529 |
|
530 |
|
531 |
|
532 | </td>
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 | <td class="description last">
|
539 | <p>a standard Object.defineProperty style<br>descriptor object.</p>
|
540 |
|
541 | </td>
|
542 | </tr>
|
543 |
|
544 |
|
545 | </tbody>
|
546 | </table>
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | </div>
|
564 |
|
565 |
|
566 | <div class="section-method">
|
567 |
|
568 |
|
569 |
|
570 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80FileSchema"><span class="type-signature">(static) </span>.🏷⠀FileSchema<span class="signature">(path, extension)</span><span class="type-signature"> → {mixed}</span></h4>
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 | <div class="description">
|
577 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
578 | </div>
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 | <dl class="details">
|
585 |
|
586 |
|
587 |
|
588 |
|
589 | <dt class="tag-since">Since:</dt>
|
590 | <dd class="tag-since"><ul class="dummy"><li>2.3.0</li></ul></dd>
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 | <dt class="tag-source">Source:</dt>
|
615 | <dd class="tag-source"><ul class="dummy"><li>
|
616 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line6">line 6</a>
|
617 | </li></ul></dd>
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 | </dl>
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 | <h5>Parameters:</h5>
|
636 |
|
637 |
|
638 | <table class="params">
|
639 | <thead>
|
640 | <tr>
|
641 |
|
642 | <th>Name</th>
|
643 |
|
644 |
|
645 | <th>Type</th>
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 | <th class="last">Description</th>
|
652 | </tr>
|
653 | </thead>
|
654 |
|
655 | <tbody>
|
656 |
|
657 |
|
658 | <tr>
|
659 |
|
660 | <td class="name"><code>path</code></td>
|
661 |
|
662 |
|
663 | <td class="type">
|
664 |
|
665 |
|
666 | <span class="param-type"><code>String</code></span>
|
667 |
|
668 |
|
669 |
|
670 | </td>
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
|
676 | <td class="description last">
|
677 | <p>a relative or absolute path to the file containing<br>your GraphQL IDL schema portion for your object type.</p>
|
678 |
|
679 | </td>
|
680 | </tr>
|
681 |
|
682 |
|
683 |
|
684 | <tr>
|
685 |
|
686 | <td class="name"><code>extension</code></td>
|
687 |
|
688 |
|
689 | <td class="type">
|
690 |
|
691 |
|
692 | <span class="param-type"><code>String</code></span>
|
693 |
|
694 |
|
695 |
|
696 | </td>
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 | <td class="description last">
|
703 | <p>the extension of the graphql schema file pointed<br>to in the previous parameter. By default these are <code>".graphql"</code> but should<br>your path point to a file with a different extension, you should specify<br>that extension here.</p>
|
704 |
|
705 | </td>
|
706 | </tr>
|
707 |
|
708 |
|
709 | </tbody>
|
710 | </table>
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 | <div class="section-returns">
|
726 | <h5>Returns:</h5>
|
727 |
|
728 |
|
729 |
|
730 | <dl class="param-type">
|
731 | <dt>
|
732 | Type:
|
733 | </dt>
|
734 | <dd>
|
735 |
|
736 | <span class="param-type"><code>mixed</code></span>
|
737 |
|
738 |
|
739 | </dd>
|
740 | </dl>
|
741 |
|
742 |
|
743 | <div class="param-desc">
|
744 | <p>as per all class decorators, <code>FileSchema</code> returns the<br>class object being modified</p>
|
745 | </div>
|
746 |
|
747 |
|
748 | </div>
|
749 |
|
750 |
|
751 |
|
752 | </div>
|
753 |
|
754 |
|
755 | <div class="section-method">
|
756 |
|
757 |
|
758 |
|
759 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Getters"><span class="type-signature">(static) </span>.🏷⠀Getters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 | <div class="description">
|
766 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
767 | </div>
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 | <dl class="details">
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 | <dt class="tag-source">Source:</dt>
|
801 | <dd class="tag-source"><ul class="dummy"><li>
|
802 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line337">line 337</a>
|
803 | </li></ul></dd>
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 | </dl>
|
812 |
|
813 |
|
814 |
|
815 |
|
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 | <h5>Parameters:</h5>
|
822 |
|
823 |
|
824 | <table class="params">
|
825 | <thead>
|
826 | <tr>
|
827 |
|
828 | <th>Name</th>
|
829 |
|
830 |
|
831 | <th>Type</th>
|
832 |
|
833 |
|
834 |
|
835 |
|
836 |
|
837 | <th class="last">Description</th>
|
838 | </tr>
|
839 | </thead>
|
840 |
|
841 | <tbody>
|
842 |
|
843 |
|
844 | <tr>
|
845 |
|
846 | <td class="name"><code>propertyNames</code></td>
|
847 |
|
848 |
|
849 | <td class="type">
|
850 |
|
851 |
|
852 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
853 |
|
854 |
|
855 |
|
856 | </td>
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 | <td class="description last">
|
863 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters that surface those properties as GraphQL fields.</p>
|
864 |
|
865 | </td>
|
866 | </tr>
|
867 |
|
868 |
|
869 | </tbody>
|
870 | </table>
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 | <div class="section-returns">
|
886 | <h5>Returns:</h5>
|
887 |
|
888 |
|
889 |
|
890 | <dl class="param-type">
|
891 | <dt>
|
892 | Type:
|
893 | </dt>
|
894 | <dd>
|
895 |
|
896 | <span class="param-type"><code>function</code></span>
|
897 |
|
898 |
|
899 | </dd>
|
900 | </dl>
|
901 |
|
902 |
|
903 | <div class="param-desc">
|
904 | <p>a class decorator method.s</p>
|
905 | </div>
|
906 |
|
907 |
|
908 | </div>
|
909 |
|
910 |
|
911 |
|
912 | </div>
|
913 |
|
914 |
|
915 | <div class="section-method">
|
916 |
|
917 |
|
918 |
|
919 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Properties"><span class="type-signature">(static) </span>.🏷⠀Properties<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 | <div class="description">
|
926 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
927 | <p>This method creates both getters and setters</p>
|
928 | </div>
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 | <dl class="details">
|
935 |
|
936 |
|
937 |
|
938 |
|
939 | <dt class="tag-since">Since:</dt>
|
940 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 | <dt class="tag-source">Source:</dt>
|
965 | <dd class="tag-source"><ul class="dummy"><li>
|
966 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line426">line 426</a>
|
967 | </li></ul></dd>
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 | </dl>
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 | <h5>Parameters:</h5>
|
986 |
|
987 |
|
988 | <table class="params">
|
989 | <thead>
|
990 | <tr>
|
991 |
|
992 | <th>Name</th>
|
993 |
|
994 |
|
995 | <th>Type</th>
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 | <th class="last">Description</th>
|
1002 | </tr>
|
1003 | </thead>
|
1004 |
|
1005 | <tbody>
|
1006 |
|
1007 |
|
1008 | <tr>
|
1009 |
|
1010 | <td class="name"><code>propertyNames</code></td>
|
1011 |
|
1012 |
|
1013 | <td class="type">
|
1014 |
|
1015 |
|
1016 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
1017 |
|
1018 |
|
1019 |
|
1020 | </td>
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 | <td class="description last">
|
1027 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters and setters that surface those properties as GraphQL fields.</p>
|
1028 |
|
1029 | </td>
|
1030 | </tr>
|
1031 |
|
1032 |
|
1033 | </tbody>
|
1034 | </table>
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 | <div class="section-returns">
|
1050 | <h5>Returns:</h5>
|
1051 |
|
1052 |
|
1053 |
|
1054 | <dl class="param-type">
|
1055 | <dt>
|
1056 | Type:
|
1057 | </dt>
|
1058 | <dd>
|
1059 |
|
1060 | <span class="param-type"><code>function</code></span>
|
1061 |
|
1062 |
|
1063 | </dd>
|
1064 | </dl>
|
1065 |
|
1066 |
|
1067 | <div class="param-desc">
|
1068 | <p>a class decorator method</p>
|
1069 | </div>
|
1070 |
|
1071 |
|
1072 | </div>
|
1073 |
|
1074 |
|
1075 |
|
1076 | </div>
|
1077 |
|
1078 |
|
1079 | <div class="section-method">
|
1080 |
|
1081 |
|
1082 |
|
1083 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Schema"><span class="type-signature">(static) </span>.🏷⠀Schema<span class="signature">(schemaString)</span><span class="type-signature"></span></h4>
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 | <div class="description">
|
1090 | <p>This decorator allows you to specify the SCHEMA getter and associated<br>string as a parameter to the decorator itself. So, for example:</p>
|
1091 | <p><code></p>
|
1092 | </div>
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 | <dl class="details">
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 | <dt class="tag-since">Since:</dt>
|
1104 | <dd class="tag-since"><ul class="dummy"><li>2.2.0</li></ul></dd>
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 | <dt class="tag-source">Source:</dt>
|
1129 | <dd class="tag-source"><ul class="dummy"><li>
|
1130 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line4">line 4</a>
|
1131 | </li></ul></dd>
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 | </dl>
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 | <h5>Parameters:</h5>
|
1150 |
|
1151 |
|
1152 | <table class="params">
|
1153 | <thead>
|
1154 | <tr>
|
1155 |
|
1156 | <th>Name</th>
|
1157 |
|
1158 |
|
1159 | <th>Type</th>
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 | <th class="last">Description</th>
|
1166 | </tr>
|
1167 | </thead>
|
1168 |
|
1169 | <tbody>
|
1170 |
|
1171 |
|
1172 | <tr>
|
1173 |
|
1174 | <td class="name"><code>schemaString</code></td>
|
1175 |
|
1176 |
|
1177 | <td class="type">
|
1178 |
|
1179 |
|
1180 | <span class="param-type"><code>string</code></span>
|
1181 |
|
1182 |
|
1183 |
|
1184 | </td>
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 | <td class="description last">
|
1191 | <p>a GraphQL IDL compliant string for defining a<br>GraphQL Object Schema.</p>
|
1192 |
|
1193 | </td>
|
1194 | </tr>
|
1195 |
|
1196 |
|
1197 | </tbody>
|
1198 | </table>
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 | </div>
|
1216 |
|
1217 |
|
1218 | <div class="section-method">
|
1219 |
|
1220 |
|
1221 |
|
1222 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Setters"><span class="type-signature">(static) </span>.🏷⠀Setters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 | <div class="description">
|
1229 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the setters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which setters should be injected.</p>
|
1230 | </div>
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 | <dl class="details">
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 | <dt class="tag-since">Since:</dt>
|
1242 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 | <dt class="tag-source">Source:</dt>
|
1267 | <dd class="tag-source"><ul class="dummy"><li>
|
1268 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line381">line 381</a>
|
1269 | </li></ul></dd>
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 | </dl>
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 | <h5>Parameters:</h5>
|
1288 |
|
1289 |
|
1290 | <table class="params">
|
1291 | <thead>
|
1292 | <tr>
|
1293 |
|
1294 | <th>Name</th>
|
1295 |
|
1296 |
|
1297 | <th>Type</th>
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 | <th class="last">Description</th>
|
1304 | </tr>
|
1305 | </thead>
|
1306 |
|
1307 | <tbody>
|
1308 |
|
1309 |
|
1310 | <tr>
|
1311 |
|
1312 | <td class="name"><code>propertyNames</code></td>
|
1313 |
|
1314 |
|
1315 | <td class="type">
|
1316 |
|
1317 |
|
1318 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
1319 |
|
1320 |
|
1321 |
|
1322 | </td>
|
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 | <td class="description last">
|
1329 | <p>if the model has<br>'name' and 'age' as properties, then passing those two strings will<br>result in setters that surface those properties as GraphQL fields.</p>
|
1330 |
|
1331 | </td>
|
1332 | </tr>
|
1333 |
|
1334 |
|
1335 | </tbody>
|
1336 | </table>
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 | <div class="section-returns">
|
1352 | <h5>Returns:</h5>
|
1353 |
|
1354 |
|
1355 |
|
1356 | <dl class="param-type">
|
1357 | <dt>
|
1358 | Type:
|
1359 | </dt>
|
1360 | <dd>
|
1361 |
|
1362 | <span class="param-type"><code>function</code></span>
|
1363 |
|
1364 |
|
1365 | </dd>
|
1366 | </dl>
|
1367 |
|
1368 |
|
1369 | <div class="param-desc">
|
1370 | <p>a class decorator method</p>
|
1371 | </div>
|
1372 |
|
1373 |
|
1374 | </div>
|
1375 |
|
1376 |
|
1377 |
|
1378 | </div>
|
1379 |
|
1380 |
|
1381 | <div class="section-method">
|
1382 |
|
1383 |
|
1384 |
|
1385 | <h4 class="name" id="~decorate"><span class="type-signature">(inner) </span>decorate<span class="signature">(metaProperty, target, key, descriptor)</span><span class="type-signature"></span></h4>
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 |
|
1391 | <div class="description">
|
1392 | <p>Since the bulk functionality of @subscriptor, @mutator and</p>
|
1393 | </div>
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 |
|
1399 | <dl class="details">
|
1400 |
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 |
|
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 | <dt class="tag-source">Source:</dt>
|
1427 | <dd class="tag-source"><ul class="dummy"><li>
|
1428 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line7">line 7</a>
|
1429 | </li></ul></dd>
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 | </dl>
|
1438 |
|
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 | <h5>Parameters:</h5>
|
1448 |
|
1449 |
|
1450 | <table class="params">
|
1451 | <thead>
|
1452 | <tr>
|
1453 |
|
1454 | <th>Name</th>
|
1455 |
|
1456 |
|
1457 | <th>Type</th>
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 | <th class="last">Description</th>
|
1464 | </tr>
|
1465 | </thead>
|
1466 |
|
1467 | <tbody>
|
1468 |
|
1469 |
|
1470 | <tr>
|
1471 |
|
1472 | <td class="name"><code>metaProperty</code></td>
|
1473 |
|
1474 |
|
1475 | <td class="type">
|
1476 |
|
1477 |
|
1478 | <span class="param-type"><code>string</code></span>
|
1479 |
|
1480 |
|
1481 |
|
1482 | </td>
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 | <td class="description last">
|
1489 | <p>the name of the meta sub key under which to<br>store the modified decorated function.</p>
|
1490 |
|
1491 | </td>
|
1492 | </tr>
|
1493 |
|
1494 |
|
1495 |
|
1496 | <tr>
|
1497 |
|
1498 | <td class="name"><code>target</code></td>
|
1499 |
|
1500 |
|
1501 | <td class="type">
|
1502 |
|
1503 |
|
1504 | <span class="param-type"><code>Object</code></span>
|
1505 | |
|
1506 |
|
1507 | <span class="param-type"><code>function</code></span>
|
1508 |
|
1509 |
|
1510 |
|
1511 | </td>
|
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 | <td class="description last">
|
1518 | <p>either the Class itself, if defined<br>on a static method, or the prototype if defined on an instance method</p>
|
1519 |
|
1520 | </td>
|
1521 | </tr>
|
1522 |
|
1523 |
|
1524 |
|
1525 | <tr>
|
1526 |
|
1527 | <td class="name"><code>key</code></td>
|
1528 |
|
1529 |
|
1530 | <td class="type">
|
1531 |
|
1532 |
|
1533 | <span class="param-type"><code>string</code></span>
|
1534 |
|
1535 |
|
1536 |
|
1537 | </td>
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 | <td class="description last">
|
1544 | <p>the property name of the function being decorated</p>
|
1545 |
|
1546 | </td>
|
1547 | </tr>
|
1548 |
|
1549 |
|
1550 |
|
1551 | <tr>
|
1552 |
|
1553 | <td class="name"><code>descriptor</code></td>
|
1554 |
|
1555 |
|
1556 | <td class="type">
|
1557 |
|
1558 |
|
1559 | <span class="param-type"><code>Object</code></span>
|
1560 |
|
1561 |
|
1562 |
|
1563 | </td>
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 |
|
1569 | <td class="description last">
|
1570 | <p>a decorator descriptor; see<br><code>Object.defineProperty</code> for more information on descriptors</p>
|
1571 |
|
1572 | </td>
|
1573 | </tr>
|
1574 |
|
1575 |
|
1576 | </tbody>
|
1577 | </table>
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 | </div>
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 | </article>
|
1602 |
|
1603 | </section>
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 | <section>
|
1612 |
|
1613 | <header>
|
1614 |
|
1615 | <h2>
|
1616 | decorators
|
1617 | </h2>
|
1618 |
|
1619 |
|
1620 | </header>
|
1621 |
|
1622 | <article>
|
1623 | <div class="container-overview">
|
1624 |
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 | <dl class="details">
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 | <dt class="tag-source">Source:</dt>
|
1658 | <dd class="tag-source"><ul class="dummy"><li>
|
1659 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line15">line 15</a>
|
1660 | </li></ul></dd>
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 | </dl>
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 | </div>
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 | <h3 class="subsection-title">Members</h3>
|
1687 |
|
1688 |
|
1689 |
|
1690 | <div class="section-members">
|
1691 | <h4 class="name" id=".DirectTypeManager"><span class="type-signature">(static, constant) </span>DirectTypeManager<span class="type-signature"> :Object</span></h4>
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 | <div class="description">
|
1697 | <p>A small suite of functions a getter that allows easy manipulation of the<br>the DIRECT_TYPES workaround needed for some types of complex class<br>wrapping allowed by the @Getters and @Properties decorators. Namely the<br>ability to do something like @Getters('name', String) which would wrap the<br>contents of whatever is in the objects model in a String call.</p>
|
1698 | <p>Direct types are those that need to be called without <code>new</code> in order for the<br>desired behavior to present itself.</p>
|
1699 | </div>
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 | <dl class="details">
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 | <dt class="tag-since">Since:</dt>
|
1711 | <dd class="tag-since"><ul class="dummy"><li>2.7.0</li></ul></dd>
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 | <dt class="tag-source">Source:</dt>
|
1736 | <dd class="tag-source"><ul class="dummy"><li>
|
1737 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line214">line 214</a>
|
1738 | </li></ul></dd>
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 | </dl>
|
1747 |
|
1748 |
|
1749 |
|
1750 | <h5>Type:</h5>
|
1751 | <ul>
|
1752 | <li>
|
1753 |
|
1754 | <span class="param-type"><code>Object</code></span>
|
1755 |
|
1756 |
|
1757 | </li>
|
1758 | </ul>
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 | </div>
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 | <h3 class="subsection-title">Methods</h3>
|
1771 |
|
1772 |
|
1773 |
|
1774 | <div class="section-method">
|
1775 |
|
1776 |
|
1777 |
|
1778 | <h4 class="name" id=".%E2%8C%BE%E2%A0%80extractBits"><span class="type-signature">(static) </span>⌾⠀extractBits<span class="signature">(property)</span><span class="type-signature"> → {Object}</span></h4>
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 | <div class="description">
|
1785 | <p>For each of the decorators, Getters, Setters, and Properties, we take a<br>list of property names used to create the appropriate accessor types. In<br>some cases, however, the instance of GQLBase's data model may have a<br>different name. Finally if the return type for the getter should be wrapped<br>in a another GQLBase class type, we will need a way to specify those things<br>too.</p>
|
1786 | <p>The <code>extractBits()</code> takes a single argument value from the decorator as it<br>parses them and converts it into an object, properly sorted, into values that<br>allow the above described behavior.</p>
|
1787 | <p>Examples:</p>
|
1788 | <p>```<br>// Create a class with a name and age property that map directly to the<br>// underlying data model</p>
|
1789 | </div>
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 | <dl class="details">
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 | <dt class="tag-since">Since:</dt>
|
1801 | <dd class="tag-since"><ul class="dummy"><li>2.5</li></ul></dd>
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 | <dt class="tag-source">Source:</dt>
|
1826 | <dd class="tag-source"><ul class="dummy"><li>
|
1827 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line11">line 11</a>
|
1828 | </li></ul></dd>
|
1829 |
|
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 | </dl>
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 | <h5>Parameters:</h5>
|
1847 |
|
1848 |
|
1849 | <table class="params">
|
1850 | <thead>
|
1851 | <tr>
|
1852 |
|
1853 | <th>Name</th>
|
1854 |
|
1855 |
|
1856 | <th>Type</th>
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 | <th class="last">Description</th>
|
1863 | </tr>
|
1864 | </thead>
|
1865 |
|
1866 | <tbody>
|
1867 |
|
1868 |
|
1869 | <tr>
|
1870 |
|
1871 | <td class="name"><code>property</code></td>
|
1872 |
|
1873 |
|
1874 | <td class="type">
|
1875 |
|
1876 |
|
1877 | <span class="param-type"><code>String</code></span>
|
1878 | |
|
1879 |
|
1880 | <span class="param-type"><code>Array.<(String|function())></code></span>
|
1881 |
|
1882 |
|
1883 |
|
1884 | </td>
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 | <td class="description last">
|
1891 | <p>name of a property, or list<br>of property names and a Class.</p>
|
1892 |
|
1893 | </td>
|
1894 | </tr>
|
1895 |
|
1896 |
|
1897 | </tbody>
|
1898 | </table>
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 |
|
1913 | <div class="section-returns">
|
1914 | <h5>Returns:</h5>
|
1915 |
|
1916 |
|
1917 |
|
1918 | <dl class="param-type">
|
1919 | <dt>
|
1920 | Type:
|
1921 | </dt>
|
1922 | <dd>
|
1923 |
|
1924 | <span class="param-type"><code>Object</code></span>
|
1925 |
|
1926 |
|
1927 | </dd>
|
1928 | </dl>
|
1929 |
|
1930 |
|
1931 | <div class="param-desc">
|
1932 | <p>an object with the following format <code>{
|
1933 | fieldName: name of root instance property to create
|
1934 | modelName: name of its associated internal model property
|
1935 | typeClass: an optional class to wrap around the results in a getter
|
1936 | }</code></p>
|
1937 | </div>
|
1938 |
|
1939 |
|
1940 | </div>
|
1941 |
|
1942 |
|
1943 |
|
1944 | </div>
|
1945 |
|
1946 |
|
1947 | <div class="section-method">
|
1948 |
|
1949 |
|
1950 |
|
1951 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80AdjacentSchema"><span class="type-signature">(static) </span>.🏷⠀AdjacentSchema<span class="signature">(object, property, descriptor)</span><span class="type-signature"></span></h4>
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 | <div class="description">
|
1958 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
1959 | </div>
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 | <dl class="details">
|
1966 |
|
1967 |
|
1968 |
|
1969 |
|
1970 | <dt class="tag-since">Since:</dt>
|
1971 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 |
|
1992 |
|
1993 |
|
1994 |
|
1995 | <dt class="tag-source">Source:</dt>
|
1996 | <dd class="tag-source"><ul class="dummy"><li>
|
1997 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line6">line 6</a>
|
1998 | </li></ul></dd>
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 | </dl>
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 | <h5>Parameters:</h5>
|
2017 |
|
2018 |
|
2019 | <table class="params">
|
2020 | <thead>
|
2021 | <tr>
|
2022 |
|
2023 | <th>Name</th>
|
2024 |
|
2025 |
|
2026 | <th>Type</th>
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 | <th class="last">Description</th>
|
2033 | </tr>
|
2034 | </thead>
|
2035 |
|
2036 | <tbody>
|
2037 |
|
2038 |
|
2039 | <tr>
|
2040 |
|
2041 | <td class="name"><code>object</code></td>
|
2042 |
|
2043 |
|
2044 | <td class="type">
|
2045 |
|
2046 |
|
2047 | <span class="param-type"><code>mixed</code></span>
|
2048 |
|
2049 |
|
2050 |
|
2051 | </td>
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 | <td class="description last">
|
2058 | <p>the object on which to apply the decorator</p>
|
2059 |
|
2060 | </td>
|
2061 | </tr>
|
2062 |
|
2063 |
|
2064 |
|
2065 | <tr>
|
2066 |
|
2067 | <td class="name"><code>property</code></td>
|
2068 |
|
2069 |
|
2070 | <td class="type">
|
2071 |
|
2072 |
|
2073 | <span class="param-type"><code>String</code></span>
|
2074 |
|
2075 |
|
2076 |
|
2077 | </td>
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 | <td class="description last">
|
2084 | <p>the name of the object or property to<br>which the decorator is being applied.</p>
|
2085 |
|
2086 | </td>
|
2087 | </tr>
|
2088 |
|
2089 |
|
2090 |
|
2091 | <tr>
|
2092 |
|
2093 | <td class="name"><code>descriptor</code></td>
|
2094 |
|
2095 |
|
2096 | <td class="type">
|
2097 |
|
2098 |
|
2099 | <span class="param-type"><code>Object</code></span>
|
2100 |
|
2101 |
|
2102 |
|
2103 | </td>
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 | <td class="description last">
|
2110 | <p>a standard Object.defineProperty style<br>descriptor object.</p>
|
2111 |
|
2112 | </td>
|
2113 | </tr>
|
2114 |
|
2115 |
|
2116 | </tbody>
|
2117 | </table>
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 | </div>
|
2135 |
|
2136 |
|
2137 | <div class="section-method">
|
2138 |
|
2139 |
|
2140 |
|
2141 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80FileSchema"><span class="type-signature">(static) </span>.🏷⠀FileSchema<span class="signature">(path, extension)</span><span class="type-signature"> → {mixed}</span></h4>
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 | <div class="description">
|
2148 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
2149 | </div>
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 | <dl class="details">
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 | <dt class="tag-since">Since:</dt>
|
2161 | <dd class="tag-since"><ul class="dummy"><li>2.3.0</li></ul></dd>
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 |
|
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 | <dt class="tag-source">Source:</dt>
|
2186 | <dd class="tag-source"><ul class="dummy"><li>
|
2187 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line6">line 6</a>
|
2188 | </li></ul></dd>
|
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 |
|
2196 | </dl>
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 | <h5>Parameters:</h5>
|
2207 |
|
2208 |
|
2209 | <table class="params">
|
2210 | <thead>
|
2211 | <tr>
|
2212 |
|
2213 | <th>Name</th>
|
2214 |
|
2215 |
|
2216 | <th>Type</th>
|
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 |
|
2222 | <th class="last">Description</th>
|
2223 | </tr>
|
2224 | </thead>
|
2225 |
|
2226 | <tbody>
|
2227 |
|
2228 |
|
2229 | <tr>
|
2230 |
|
2231 | <td class="name"><code>path</code></td>
|
2232 |
|
2233 |
|
2234 | <td class="type">
|
2235 |
|
2236 |
|
2237 | <span class="param-type"><code>String</code></span>
|
2238 |
|
2239 |
|
2240 |
|
2241 | </td>
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 | <td class="description last">
|
2248 | <p>a relative or absolute path to the file containing<br>your GraphQL IDL schema portion for your object type.</p>
|
2249 |
|
2250 | </td>
|
2251 | </tr>
|
2252 |
|
2253 |
|
2254 |
|
2255 | <tr>
|
2256 |
|
2257 | <td class="name"><code>extension</code></td>
|
2258 |
|
2259 |
|
2260 | <td class="type">
|
2261 |
|
2262 |
|
2263 | <span class="param-type"><code>String</code></span>
|
2264 |
|
2265 |
|
2266 |
|
2267 | </td>
|
2268 |
|
2269 |
|
2270 |
|
2271 |
|
2272 |
|
2273 | <td class="description last">
|
2274 | <p>the extension of the graphql schema file pointed<br>to in the previous parameter. By default these are <code>".graphql"</code> but should<br>your path point to a file with a different extension, you should specify<br>that extension here.</p>
|
2275 |
|
2276 | </td>
|
2277 | </tr>
|
2278 |
|
2279 |
|
2280 | </tbody>
|
2281 | </table>
|
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 |
|
2294 |
|
2295 |
|
2296 | <div class="section-returns">
|
2297 | <h5>Returns:</h5>
|
2298 |
|
2299 |
|
2300 |
|
2301 | <dl class="param-type">
|
2302 | <dt>
|
2303 | Type:
|
2304 | </dt>
|
2305 | <dd>
|
2306 |
|
2307 | <span class="param-type"><code>mixed</code></span>
|
2308 |
|
2309 |
|
2310 | </dd>
|
2311 | </dl>
|
2312 |
|
2313 |
|
2314 | <div class="param-desc">
|
2315 | <p>as per all class decorators, <code>FileSchema</code> returns the<br>class object being modified</p>
|
2316 | </div>
|
2317 |
|
2318 |
|
2319 | </div>
|
2320 |
|
2321 |
|
2322 |
|
2323 | </div>
|
2324 |
|
2325 |
|
2326 | <div class="section-method">
|
2327 |
|
2328 |
|
2329 |
|
2330 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Getters"><span class="type-signature">(static) </span>.🏷⠀Getters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 | <div class="description">
|
2337 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
2338 | </div>
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 | <dl class="details">
|
2345 |
|
2346 |
|
2347 |
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 | <dt class="tag-source">Source:</dt>
|
2372 | <dd class="tag-source"><ul class="dummy"><li>
|
2373 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line337">line 337</a>
|
2374 | </li></ul></dd>
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 | </dl>
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 | <h5>Parameters:</h5>
|
2393 |
|
2394 |
|
2395 | <table class="params">
|
2396 | <thead>
|
2397 | <tr>
|
2398 |
|
2399 | <th>Name</th>
|
2400 |
|
2401 |
|
2402 | <th>Type</th>
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 |
|
2408 | <th class="last">Description</th>
|
2409 | </tr>
|
2410 | </thead>
|
2411 |
|
2412 | <tbody>
|
2413 |
|
2414 |
|
2415 | <tr>
|
2416 |
|
2417 | <td class="name"><code>propertyNames</code></td>
|
2418 |
|
2419 |
|
2420 | <td class="type">
|
2421 |
|
2422 |
|
2423 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
2424 |
|
2425 |
|
2426 |
|
2427 | </td>
|
2428 |
|
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 | <td class="description last">
|
2434 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters that surface those properties as GraphQL fields.</p>
|
2435 |
|
2436 | </td>
|
2437 | </tr>
|
2438 |
|
2439 |
|
2440 | </tbody>
|
2441 | </table>
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 | <div class="section-returns">
|
2457 | <h5>Returns:</h5>
|
2458 |
|
2459 |
|
2460 |
|
2461 | <dl class="param-type">
|
2462 | <dt>
|
2463 | Type:
|
2464 | </dt>
|
2465 | <dd>
|
2466 |
|
2467 | <span class="param-type"><code>function</code></span>
|
2468 |
|
2469 |
|
2470 | </dd>
|
2471 | </dl>
|
2472 |
|
2473 |
|
2474 | <div class="param-desc">
|
2475 | <p>a class decorator method.s</p>
|
2476 | </div>
|
2477 |
|
2478 |
|
2479 | </div>
|
2480 |
|
2481 |
|
2482 |
|
2483 | </div>
|
2484 |
|
2485 |
|
2486 | <div class="section-method">
|
2487 |
|
2488 |
|
2489 |
|
2490 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Properties"><span class="type-signature">(static) </span>.🏷⠀Properties<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 | <div class="description">
|
2497 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
2498 | <p>This method creates both getters and setters</p>
|
2499 | </div>
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 | <dl class="details">
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 | <dt class="tag-since">Since:</dt>
|
2511 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 | <dt class="tag-source">Source:</dt>
|
2536 | <dd class="tag-source"><ul class="dummy"><li>
|
2537 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line426">line 426</a>
|
2538 | </li></ul></dd>
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 |
|
2546 | </dl>
|
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 |
|
2556 | <h5>Parameters:</h5>
|
2557 |
|
2558 |
|
2559 | <table class="params">
|
2560 | <thead>
|
2561 | <tr>
|
2562 |
|
2563 | <th>Name</th>
|
2564 |
|
2565 |
|
2566 | <th>Type</th>
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 |
|
2572 | <th class="last">Description</th>
|
2573 | </tr>
|
2574 | </thead>
|
2575 |
|
2576 | <tbody>
|
2577 |
|
2578 |
|
2579 | <tr>
|
2580 |
|
2581 | <td class="name"><code>propertyNames</code></td>
|
2582 |
|
2583 |
|
2584 | <td class="type">
|
2585 |
|
2586 |
|
2587 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
2588 |
|
2589 |
|
2590 |
|
2591 | </td>
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 | <td class="description last">
|
2598 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters and setters that surface those properties as GraphQL fields.</p>
|
2599 |
|
2600 | </td>
|
2601 | </tr>
|
2602 |
|
2603 |
|
2604 | </tbody>
|
2605 | </table>
|
2606 |
|
2607 |
|
2608 |
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 | <div class="section-returns">
|
2621 | <h5>Returns:</h5>
|
2622 |
|
2623 |
|
2624 |
|
2625 | <dl class="param-type">
|
2626 | <dt>
|
2627 | Type:
|
2628 | </dt>
|
2629 | <dd>
|
2630 |
|
2631 | <span class="param-type"><code>function</code></span>
|
2632 |
|
2633 |
|
2634 | </dd>
|
2635 | </dl>
|
2636 |
|
2637 |
|
2638 | <div class="param-desc">
|
2639 | <p>a class decorator method</p>
|
2640 | </div>
|
2641 |
|
2642 |
|
2643 | </div>
|
2644 |
|
2645 |
|
2646 |
|
2647 | </div>
|
2648 |
|
2649 |
|
2650 | <div class="section-method">
|
2651 |
|
2652 |
|
2653 |
|
2654 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Schema"><span class="type-signature">(static) </span>.🏷⠀Schema<span class="signature">(schemaString)</span><span class="type-signature"></span></h4>
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 | <div class="description">
|
2661 | <p>This decorator allows you to specify the SCHEMA getter and associated<br>string as a parameter to the decorator itself. So, for example:</p>
|
2662 | <p><code></p>
|
2663 | </div>
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 | <dl class="details">
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 | <dt class="tag-since">Since:</dt>
|
2675 | <dd class="tag-since"><ul class="dummy"><li>2.2.0</li></ul></dd>
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 |
|
2696 |
|
2697 |
|
2698 |
|
2699 | <dt class="tag-source">Source:</dt>
|
2700 | <dd class="tag-source"><ul class="dummy"><li>
|
2701 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line4">line 4</a>
|
2702 | </li></ul></dd>
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 |
|
2710 | </dl>
|
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 | <h5>Parameters:</h5>
|
2721 |
|
2722 |
|
2723 | <table class="params">
|
2724 | <thead>
|
2725 | <tr>
|
2726 |
|
2727 | <th>Name</th>
|
2728 |
|
2729 |
|
2730 | <th>Type</th>
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 | <th class="last">Description</th>
|
2737 | </tr>
|
2738 | </thead>
|
2739 |
|
2740 | <tbody>
|
2741 |
|
2742 |
|
2743 | <tr>
|
2744 |
|
2745 | <td class="name"><code>schemaString</code></td>
|
2746 |
|
2747 |
|
2748 | <td class="type">
|
2749 |
|
2750 |
|
2751 | <span class="param-type"><code>string</code></span>
|
2752 |
|
2753 |
|
2754 |
|
2755 | </td>
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 | <td class="description last">
|
2762 | <p>a GraphQL IDL compliant string for defining a<br>GraphQL Object Schema.</p>
|
2763 |
|
2764 | </td>
|
2765 | </tr>
|
2766 |
|
2767 |
|
2768 | </tbody>
|
2769 | </table>
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 | </div>
|
2787 |
|
2788 |
|
2789 | <div class="section-method">
|
2790 |
|
2791 |
|
2792 |
|
2793 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Setters"><span class="type-signature">(static) </span>.🏷⠀Setters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
2794 |
|
2795 |
|
2796 |
|
2797 |
|
2798 |
|
2799 | <div class="description">
|
2800 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the setters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which setters should be injected.</p>
|
2801 | </div>
|
2802 |
|
2803 |
|
2804 |
|
2805 |
|
2806 |
|
2807 | <dl class="details">
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 | <dt class="tag-since">Since:</dt>
|
2813 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 |
|
2828 |
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 | <dt class="tag-source">Source:</dt>
|
2838 | <dd class="tag-source"><ul class="dummy"><li>
|
2839 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line381">line 381</a>
|
2840 | </li></ul></dd>
|
2841 |
|
2842 |
|
2843 |
|
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 | </dl>
|
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 | <h5>Parameters:</h5>
|
2859 |
|
2860 |
|
2861 | <table class="params">
|
2862 | <thead>
|
2863 | <tr>
|
2864 |
|
2865 | <th>Name</th>
|
2866 |
|
2867 |
|
2868 | <th>Type</th>
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 | <th class="last">Description</th>
|
2875 | </tr>
|
2876 | </thead>
|
2877 |
|
2878 | <tbody>
|
2879 |
|
2880 |
|
2881 | <tr>
|
2882 |
|
2883 | <td class="name"><code>propertyNames</code></td>
|
2884 |
|
2885 |
|
2886 | <td class="type">
|
2887 |
|
2888 |
|
2889 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
2890 |
|
2891 |
|
2892 |
|
2893 | </td>
|
2894 |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 | <td class="description last">
|
2900 | <p>if the model has<br>'name' and 'age' as properties, then passing those two strings will<br>result in setters that surface those properties as GraphQL fields.</p>
|
2901 |
|
2902 | </td>
|
2903 | </tr>
|
2904 |
|
2905 |
|
2906 | </tbody>
|
2907 | </table>
|
2908 |
|
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 | <div class="section-returns">
|
2923 | <h5>Returns:</h5>
|
2924 |
|
2925 |
|
2926 |
|
2927 | <dl class="param-type">
|
2928 | <dt>
|
2929 | Type:
|
2930 | </dt>
|
2931 | <dd>
|
2932 |
|
2933 | <span class="param-type"><code>function</code></span>
|
2934 |
|
2935 |
|
2936 | </dd>
|
2937 | </dl>
|
2938 |
|
2939 |
|
2940 | <div class="param-desc">
|
2941 | <p>a class decorator method</p>
|
2942 | </div>
|
2943 |
|
2944 |
|
2945 | </div>
|
2946 |
|
2947 |
|
2948 |
|
2949 | </div>
|
2950 |
|
2951 |
|
2952 | <div class="section-method">
|
2953 |
|
2954 |
|
2955 |
|
2956 | <h4 class="name" id="~decorate"><span class="type-signature">(inner) </span>decorate<span class="signature">(metaProperty, target, key, descriptor)</span><span class="type-signature"></span></h4>
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 |
|
2962 | <div class="description">
|
2963 | <p>Since the bulk functionality of @subscriptor, @mutator and</p>
|
2964 | </div>
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 | <dl class="details">
|
2971 |
|
2972 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 |
|
2982 |
|
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 |
|
2994 |
|
2995 |
|
2996 |
|
2997 | <dt class="tag-source">Source:</dt>
|
2998 | <dd class="tag-source"><ul class="dummy"><li>
|
2999 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line7">line 7</a>
|
3000 | </li></ul></dd>
|
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 | </dl>
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 | <h5>Parameters:</h5>
|
3019 |
|
3020 |
|
3021 | <table class="params">
|
3022 | <thead>
|
3023 | <tr>
|
3024 |
|
3025 | <th>Name</th>
|
3026 |
|
3027 |
|
3028 | <th>Type</th>
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 | <th class="last">Description</th>
|
3035 | </tr>
|
3036 | </thead>
|
3037 |
|
3038 | <tbody>
|
3039 |
|
3040 |
|
3041 | <tr>
|
3042 |
|
3043 | <td class="name"><code>metaProperty</code></td>
|
3044 |
|
3045 |
|
3046 | <td class="type">
|
3047 |
|
3048 |
|
3049 | <span class="param-type"><code>string</code></span>
|
3050 |
|
3051 |
|
3052 |
|
3053 | </td>
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 | <td class="description last">
|
3060 | <p>the name of the meta sub key under which to<br>store the modified decorated function.</p>
|
3061 |
|
3062 | </td>
|
3063 | </tr>
|
3064 |
|
3065 |
|
3066 |
|
3067 | <tr>
|
3068 |
|
3069 | <td class="name"><code>target</code></td>
|
3070 |
|
3071 |
|
3072 | <td class="type">
|
3073 |
|
3074 |
|
3075 | <span class="param-type"><code>Object</code></span>
|
3076 | |
|
3077 |
|
3078 | <span class="param-type"><code>function</code></span>
|
3079 |
|
3080 |
|
3081 |
|
3082 | </td>
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 | <td class="description last">
|
3089 | <p>either the Class itself, if defined<br>on a static method, or the prototype if defined on an instance method</p>
|
3090 |
|
3091 | </td>
|
3092 | </tr>
|
3093 |
|
3094 |
|
3095 |
|
3096 | <tr>
|
3097 |
|
3098 | <td class="name"><code>key</code></td>
|
3099 |
|
3100 |
|
3101 | <td class="type">
|
3102 |
|
3103 |
|
3104 | <span class="param-type"><code>string</code></span>
|
3105 |
|
3106 |
|
3107 |
|
3108 | </td>
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 | <td class="description last">
|
3115 | <p>the property name of the function being decorated</p>
|
3116 |
|
3117 | </td>
|
3118 | </tr>
|
3119 |
|
3120 |
|
3121 |
|
3122 | <tr>
|
3123 |
|
3124 | <td class="name"><code>descriptor</code></td>
|
3125 |
|
3126 |
|
3127 | <td class="type">
|
3128 |
|
3129 |
|
3130 | <span class="param-type"><code>Object</code></span>
|
3131 |
|
3132 |
|
3133 |
|
3134 | </td>
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 | <td class="description last">
|
3141 | <p>a decorator descriptor; see<br><code>Object.defineProperty</code> for more information on descriptors</p>
|
3142 |
|
3143 | </td>
|
3144 | </tr>
|
3145 |
|
3146 |
|
3147 | </tbody>
|
3148 | </table>
|
3149 |
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
3165 | </div>
|
3166 |
|
3167 |
|
3168 |
|
3169 |
|
3170 |
|
3171 |
|
3172 | </article>
|
3173 |
|
3174 | </section>
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | <section>
|
3183 |
|
3184 | <header>
|
3185 |
|
3186 | <h2>
|
3187 | decorators
|
3188 | </h2>
|
3189 |
|
3190 |
|
3191 | </header>
|
3192 |
|
3193 | <article>
|
3194 | <div class="container-overview">
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 | <dl class="details">
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 | <dt class="tag-source">Source:</dt>
|
3229 | <dd class="tag-source"><ul class="dummy"><li>
|
3230 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line36">line 36</a>
|
3231 | </li></ul></dd>
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 | </dl>
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 | </div>
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 | <h3 class="subsection-title">Members</h3>
|
3258 |
|
3259 |
|
3260 |
|
3261 | <div class="section-members">
|
3262 | <h4 class="name" id=".DirectTypeManager"><span class="type-signature">(static, constant) </span>DirectTypeManager<span class="type-signature"> :Object</span></h4>
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 | <div class="description">
|
3268 | <p>A small suite of functions a getter that allows easy manipulation of the<br>the DIRECT_TYPES workaround needed for some types of complex class<br>wrapping allowed by the @Getters and @Properties decorators. Namely the<br>ability to do something like @Getters('name', String) which would wrap the<br>contents of whatever is in the objects model in a String call.</p>
|
3269 | <p>Direct types are those that need to be called without <code>new</code> in order for the<br>desired behavior to present itself.</p>
|
3270 | </div>
|
3271 |
|
3272 |
|
3273 |
|
3274 |
|
3275 |
|
3276 | <dl class="details">
|
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | <dt class="tag-since">Since:</dt>
|
3282 | <dd class="tag-since"><ul class="dummy"><li>2.7.0</li></ul></dd>
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 | <dt class="tag-source">Source:</dt>
|
3307 | <dd class="tag-source"><ul class="dummy"><li>
|
3308 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line214">line 214</a>
|
3309 | </li></ul></dd>
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 | </dl>
|
3318 |
|
3319 |
|
3320 |
|
3321 | <h5>Type:</h5>
|
3322 | <ul>
|
3323 | <li>
|
3324 |
|
3325 | <span class="param-type"><code>Object</code></span>
|
3326 |
|
3327 |
|
3328 | </li>
|
3329 | </ul>
|
3330 |
|
3331 |
|
3332 |
|
3333 |
|
3334 |
|
3335 | </div>
|
3336 |
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 | <h3 class="subsection-title">Methods</h3>
|
3342 |
|
3343 |
|
3344 |
|
3345 | <div class="section-method">
|
3346 |
|
3347 |
|
3348 |
|
3349 | <h4 class="name" id=".%E2%8C%BE%E2%A0%80extractBits"><span class="type-signature">(static) </span>⌾⠀extractBits<span class="signature">(property)</span><span class="type-signature"> → {Object}</span></h4>
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 | <div class="description">
|
3356 | <p>For each of the decorators, Getters, Setters, and Properties, we take a<br>list of property names used to create the appropriate accessor types. In<br>some cases, however, the instance of GQLBase's data model may have a<br>different name. Finally if the return type for the getter should be wrapped<br>in a another GQLBase class type, we will need a way to specify those things<br>too.</p>
|
3357 | <p>The <code>extractBits()</code> takes a single argument value from the decorator as it<br>parses them and converts it into an object, properly sorted, into values that<br>allow the above described behavior.</p>
|
3358 | <p>Examples:</p>
|
3359 | <p>```<br>// Create a class with a name and age property that map directly to the<br>// underlying data model</p>
|
3360 | </div>
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 | <dl class="details">
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 | <dt class="tag-since">Since:</dt>
|
3372 | <dd class="tag-since"><ul class="dummy"><li>2.5</li></ul></dd>
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 | <dt class="tag-source">Source:</dt>
|
3397 | <dd class="tag-source"><ul class="dummy"><li>
|
3398 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line11">line 11</a>
|
3399 | </li></ul></dd>
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 | </dl>
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 |
|
3417 | <h5>Parameters:</h5>
|
3418 |
|
3419 |
|
3420 | <table class="params">
|
3421 | <thead>
|
3422 | <tr>
|
3423 |
|
3424 | <th>Name</th>
|
3425 |
|
3426 |
|
3427 | <th>Type</th>
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 | <th class="last">Description</th>
|
3434 | </tr>
|
3435 | </thead>
|
3436 |
|
3437 | <tbody>
|
3438 |
|
3439 |
|
3440 | <tr>
|
3441 |
|
3442 | <td class="name"><code>property</code></td>
|
3443 |
|
3444 |
|
3445 | <td class="type">
|
3446 |
|
3447 |
|
3448 | <span class="param-type"><code>String</code></span>
|
3449 | |
|
3450 |
|
3451 | <span class="param-type"><code>Array.<(String|function())></code></span>
|
3452 |
|
3453 |
|
3454 |
|
3455 | </td>
|
3456 |
|
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 | <td class="description last">
|
3462 | <p>name of a property, or list<br>of property names and a Class.</p>
|
3463 |
|
3464 | </td>
|
3465 | </tr>
|
3466 |
|
3467 |
|
3468 | </tbody>
|
3469 | </table>
|
3470 |
|
3471 |
|
3472 |
|
3473 |
|
3474 |
|
3475 |
|
3476 |
|
3477 |
|
3478 |
|
3479 |
|
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 | <div class="section-returns">
|
3485 | <h5>Returns:</h5>
|
3486 |
|
3487 |
|
3488 |
|
3489 | <dl class="param-type">
|
3490 | <dt>
|
3491 | Type:
|
3492 | </dt>
|
3493 | <dd>
|
3494 |
|
3495 | <span class="param-type"><code>Object</code></span>
|
3496 |
|
3497 |
|
3498 | </dd>
|
3499 | </dl>
|
3500 |
|
3501 |
|
3502 | <div class="param-desc">
|
3503 | <p>an object with the following format <code>{
|
3504 | fieldName: name of root instance property to create
|
3505 | modelName: name of its associated internal model property
|
3506 | typeClass: an optional class to wrap around the results in a getter
|
3507 | }</code></p>
|
3508 | </div>
|
3509 |
|
3510 |
|
3511 | </div>
|
3512 |
|
3513 |
|
3514 |
|
3515 | </div>
|
3516 |
|
3517 |
|
3518 | <div class="section-method">
|
3519 |
|
3520 |
|
3521 |
|
3522 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80AdjacentSchema"><span class="type-signature">(static) </span>.🏷⠀AdjacentSchema<span class="signature">(object, property, descriptor)</span><span class="type-signature"></span></h4>
|
3523 |
|
3524 |
|
3525 |
|
3526 |
|
3527 |
|
3528 | <div class="description">
|
3529 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
3530 | </div>
|
3531 |
|
3532 |
|
3533 |
|
3534 |
|
3535 |
|
3536 | <dl class="details">
|
3537 |
|
3538 |
|
3539 |
|
3540 |
|
3541 | <dt class="tag-since">Since:</dt>
|
3542 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
3543 |
|
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 |
|
3553 |
|
3554 |
|
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 |
|
3566 | <dt class="tag-source">Source:</dt>
|
3567 | <dd class="tag-source"><ul class="dummy"><li>
|
3568 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line6">line 6</a>
|
3569 | </li></ul></dd>
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 |
|
3577 | </dl>
|
3578 |
|
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 | <h5>Parameters:</h5>
|
3588 |
|
3589 |
|
3590 | <table class="params">
|
3591 | <thead>
|
3592 | <tr>
|
3593 |
|
3594 | <th>Name</th>
|
3595 |
|
3596 |
|
3597 | <th>Type</th>
|
3598 |
|
3599 |
|
3600 |
|
3601 |
|
3602 |
|
3603 | <th class="last">Description</th>
|
3604 | </tr>
|
3605 | </thead>
|
3606 |
|
3607 | <tbody>
|
3608 |
|
3609 |
|
3610 | <tr>
|
3611 |
|
3612 | <td class="name"><code>object</code></td>
|
3613 |
|
3614 |
|
3615 | <td class="type">
|
3616 |
|
3617 |
|
3618 | <span class="param-type"><code>mixed</code></span>
|
3619 |
|
3620 |
|
3621 |
|
3622 | </td>
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 | <td class="description last">
|
3629 | <p>the object on which to apply the decorator</p>
|
3630 |
|
3631 | </td>
|
3632 | </tr>
|
3633 |
|
3634 |
|
3635 |
|
3636 | <tr>
|
3637 |
|
3638 | <td class="name"><code>property</code></td>
|
3639 |
|
3640 |
|
3641 | <td class="type">
|
3642 |
|
3643 |
|
3644 | <span class="param-type"><code>String</code></span>
|
3645 |
|
3646 |
|
3647 |
|
3648 | </td>
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 | <td class="description last">
|
3655 | <p>the name of the object or property to<br>which the decorator is being applied.</p>
|
3656 |
|
3657 | </td>
|
3658 | </tr>
|
3659 |
|
3660 |
|
3661 |
|
3662 | <tr>
|
3663 |
|
3664 | <td class="name"><code>descriptor</code></td>
|
3665 |
|
3666 |
|
3667 | <td class="type">
|
3668 |
|
3669 |
|
3670 | <span class="param-type"><code>Object</code></span>
|
3671 |
|
3672 |
|
3673 |
|
3674 | </td>
|
3675 |
|
3676 |
|
3677 |
|
3678 |
|
3679 |
|
3680 | <td class="description last">
|
3681 | <p>a standard Object.defineProperty style<br>descriptor object.</p>
|
3682 |
|
3683 | </td>
|
3684 | </tr>
|
3685 |
|
3686 |
|
3687 | </tbody>
|
3688 | </table>
|
3689 |
|
3690 |
|
3691 |
|
3692 |
|
3693 |
|
3694 |
|
3695 |
|
3696 |
|
3697 |
|
3698 |
|
3699 |
|
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 | </div>
|
3706 |
|
3707 |
|
3708 | <div class="section-method">
|
3709 |
|
3710 |
|
3711 |
|
3712 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80FileSchema"><span class="type-signature">(static) </span>.🏷⠀FileSchema<span class="signature">(path, extension)</span><span class="type-signature"> → {mixed}</span></h4>
|
3713 |
|
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 | <div class="description">
|
3719 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
3720 | </div>
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 | <dl class="details">
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 | <dt class="tag-since">Since:</dt>
|
3732 | <dd class="tag-since"><ul class="dummy"><li>2.3.0</li></ul></dd>
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 |
|
3739 |
|
3740 |
|
3741 |
|
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 |
|
3749 |
|
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 | <dt class="tag-source">Source:</dt>
|
3757 | <dd class="tag-source"><ul class="dummy"><li>
|
3758 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line6">line 6</a>
|
3759 | </li></ul></dd>
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 | </dl>
|
3768 |
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 | <h5>Parameters:</h5>
|
3778 |
|
3779 |
|
3780 | <table class="params">
|
3781 | <thead>
|
3782 | <tr>
|
3783 |
|
3784 | <th>Name</th>
|
3785 |
|
3786 |
|
3787 | <th>Type</th>
|
3788 |
|
3789 |
|
3790 |
|
3791 |
|
3792 |
|
3793 | <th class="last">Description</th>
|
3794 | </tr>
|
3795 | </thead>
|
3796 |
|
3797 | <tbody>
|
3798 |
|
3799 |
|
3800 | <tr>
|
3801 |
|
3802 | <td class="name"><code>path</code></td>
|
3803 |
|
3804 |
|
3805 | <td class="type">
|
3806 |
|
3807 |
|
3808 | <span class="param-type"><code>String</code></span>
|
3809 |
|
3810 |
|
3811 |
|
3812 | </td>
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 | <td class="description last">
|
3819 | <p>a relative or absolute path to the file containing<br>your GraphQL IDL schema portion for your object type.</p>
|
3820 |
|
3821 | </td>
|
3822 | </tr>
|
3823 |
|
3824 |
|
3825 |
|
3826 | <tr>
|
3827 |
|
3828 | <td class="name"><code>extension</code></td>
|
3829 |
|
3830 |
|
3831 | <td class="type">
|
3832 |
|
3833 |
|
3834 | <span class="param-type"><code>String</code></span>
|
3835 |
|
3836 |
|
3837 |
|
3838 | </td>
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
3843 |
|
3844 | <td class="description last">
|
3845 | <p>the extension of the graphql schema file pointed<br>to in the previous parameter. By default these are <code>".graphql"</code> but should<br>your path point to a file with a different extension, you should specify<br>that extension here.</p>
|
3846 |
|
3847 | </td>
|
3848 | </tr>
|
3849 |
|
3850 |
|
3851 | </tbody>
|
3852 | </table>
|
3853 |
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 | <div class="section-returns">
|
3868 | <h5>Returns:</h5>
|
3869 |
|
3870 |
|
3871 |
|
3872 | <dl class="param-type">
|
3873 | <dt>
|
3874 | Type:
|
3875 | </dt>
|
3876 | <dd>
|
3877 |
|
3878 | <span class="param-type"><code>mixed</code></span>
|
3879 |
|
3880 |
|
3881 | </dd>
|
3882 | </dl>
|
3883 |
|
3884 |
|
3885 | <div class="param-desc">
|
3886 | <p>as per all class decorators, <code>FileSchema</code> returns the<br>class object being modified</p>
|
3887 | </div>
|
3888 |
|
3889 |
|
3890 | </div>
|
3891 |
|
3892 |
|
3893 |
|
3894 | </div>
|
3895 |
|
3896 |
|
3897 | <div class="section-method">
|
3898 |
|
3899 |
|
3900 |
|
3901 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Getters"><span class="type-signature">(static) </span>.🏷⠀Getters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 | <div class="description">
|
3908 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
3909 | </div>
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 | <dl class="details">
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 | <dt class="tag-source">Source:</dt>
|
3943 | <dd class="tag-source"><ul class="dummy"><li>
|
3944 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line337">line 337</a>
|
3945 | </li></ul></dd>
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 |
|
3951 |
|
3952 |
|
3953 | </dl>
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 | <h5>Parameters:</h5>
|
3964 |
|
3965 |
|
3966 | <table class="params">
|
3967 | <thead>
|
3968 | <tr>
|
3969 |
|
3970 | <th>Name</th>
|
3971 |
|
3972 |
|
3973 | <th>Type</th>
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 | <th class="last">Description</th>
|
3980 | </tr>
|
3981 | </thead>
|
3982 |
|
3983 | <tbody>
|
3984 |
|
3985 |
|
3986 | <tr>
|
3987 |
|
3988 | <td class="name"><code>propertyNames</code></td>
|
3989 |
|
3990 |
|
3991 | <td class="type">
|
3992 |
|
3993 |
|
3994 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
3995 |
|
3996 |
|
3997 |
|
3998 | </td>
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 | <td class="description last">
|
4005 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters that surface those properties as GraphQL fields.</p>
|
4006 |
|
4007 | </td>
|
4008 | </tr>
|
4009 |
|
4010 |
|
4011 | </tbody>
|
4012 | </table>
|
4013 |
|
4014 |
|
4015 |
|
4016 |
|
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 |
|
4026 |
|
4027 | <div class="section-returns">
|
4028 | <h5>Returns:</h5>
|
4029 |
|
4030 |
|
4031 |
|
4032 | <dl class="param-type">
|
4033 | <dt>
|
4034 | Type:
|
4035 | </dt>
|
4036 | <dd>
|
4037 |
|
4038 | <span class="param-type"><code>function</code></span>
|
4039 |
|
4040 |
|
4041 | </dd>
|
4042 | </dl>
|
4043 |
|
4044 |
|
4045 | <div class="param-desc">
|
4046 | <p>a class decorator method.s</p>
|
4047 | </div>
|
4048 |
|
4049 |
|
4050 | </div>
|
4051 |
|
4052 |
|
4053 |
|
4054 | </div>
|
4055 |
|
4056 |
|
4057 | <div class="section-method">
|
4058 |
|
4059 |
|
4060 |
|
4061 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Properties"><span class="type-signature">(static) </span>.🏷⠀Properties<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
4062 |
|
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 | <div class="description">
|
4068 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
4069 | <p>This method creates both getters and setters</p>
|
4070 | </div>
|
4071 |
|
4072 |
|
4073 |
|
4074 |
|
4075 |
|
4076 | <dl class="details">
|
4077 |
|
4078 |
|
4079 |
|
4080 |
|
4081 | <dt class="tag-since">Since:</dt>
|
4082 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
4083 |
|
4084 |
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 | <dt class="tag-source">Source:</dt>
|
4107 | <dd class="tag-source"><ul class="dummy"><li>
|
4108 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line426">line 426</a>
|
4109 | </li></ul></dd>
|
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 | </dl>
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 |
|
4127 | <h5>Parameters:</h5>
|
4128 |
|
4129 |
|
4130 | <table class="params">
|
4131 | <thead>
|
4132 | <tr>
|
4133 |
|
4134 | <th>Name</th>
|
4135 |
|
4136 |
|
4137 | <th>Type</th>
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 | <th class="last">Description</th>
|
4144 | </tr>
|
4145 | </thead>
|
4146 |
|
4147 | <tbody>
|
4148 |
|
4149 |
|
4150 | <tr>
|
4151 |
|
4152 | <td class="name"><code>propertyNames</code></td>
|
4153 |
|
4154 |
|
4155 | <td class="type">
|
4156 |
|
4157 |
|
4158 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
4159 |
|
4160 |
|
4161 |
|
4162 | </td>
|
4163 |
|
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 | <td class="description last">
|
4169 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters and setters that surface those properties as GraphQL fields.</p>
|
4170 |
|
4171 | </td>
|
4172 | </tr>
|
4173 |
|
4174 |
|
4175 | </tbody>
|
4176 | </table>
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 |
|
4184 |
|
4185 |
|
4186 |
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 | <div class="section-returns">
|
4192 | <h5>Returns:</h5>
|
4193 |
|
4194 |
|
4195 |
|
4196 | <dl class="param-type">
|
4197 | <dt>
|
4198 | Type:
|
4199 | </dt>
|
4200 | <dd>
|
4201 |
|
4202 | <span class="param-type"><code>function</code></span>
|
4203 |
|
4204 |
|
4205 | </dd>
|
4206 | </dl>
|
4207 |
|
4208 |
|
4209 | <div class="param-desc">
|
4210 | <p>a class decorator method</p>
|
4211 | </div>
|
4212 |
|
4213 |
|
4214 | </div>
|
4215 |
|
4216 |
|
4217 |
|
4218 | </div>
|
4219 |
|
4220 |
|
4221 | <div class="section-method">
|
4222 |
|
4223 |
|
4224 |
|
4225 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Schema"><span class="type-signature">(static) </span>.🏷⠀Schema<span class="signature">(schemaString)</span><span class="type-signature"></span></h4>
|
4226 |
|
4227 |
|
4228 |
|
4229 |
|
4230 |
|
4231 | <div class="description">
|
4232 | <p>This decorator allows you to specify the SCHEMA getter and associated<br>string as a parameter to the decorator itself. So, for example:</p>
|
4233 | <p><code></p>
|
4234 | </div>
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 | <dl class="details">
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 | <dt class="tag-since">Since:</dt>
|
4246 | <dd class="tag-since"><ul class="dummy"><li>2.2.0</li></ul></dd>
|
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 |
|
4252 |
|
4253 |
|
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 | <dt class="tag-source">Source:</dt>
|
4271 | <dd class="tag-source"><ul class="dummy"><li>
|
4272 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line4">line 4</a>
|
4273 | </li></ul></dd>
|
4274 |
|
4275 |
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 | </dl>
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 | <h5>Parameters:</h5>
|
4292 |
|
4293 |
|
4294 | <table class="params">
|
4295 | <thead>
|
4296 | <tr>
|
4297 |
|
4298 | <th>Name</th>
|
4299 |
|
4300 |
|
4301 | <th>Type</th>
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 | <th class="last">Description</th>
|
4308 | </tr>
|
4309 | </thead>
|
4310 |
|
4311 | <tbody>
|
4312 |
|
4313 |
|
4314 | <tr>
|
4315 |
|
4316 | <td class="name"><code>schemaString</code></td>
|
4317 |
|
4318 |
|
4319 | <td class="type">
|
4320 |
|
4321 |
|
4322 | <span class="param-type"><code>string</code></span>
|
4323 |
|
4324 |
|
4325 |
|
4326 | </td>
|
4327 |
|
4328 |
|
4329 |
|
4330 |
|
4331 |
|
4332 | <td class="description last">
|
4333 | <p>a GraphQL IDL compliant string for defining a<br>GraphQL Object Schema.</p>
|
4334 |
|
4335 | </td>
|
4336 | </tr>
|
4337 |
|
4338 |
|
4339 | </tbody>
|
4340 | </table>
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 | </div>
|
4358 |
|
4359 |
|
4360 | <div class="section-method">
|
4361 |
|
4362 |
|
4363 |
|
4364 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Setters"><span class="type-signature">(static) </span>.🏷⠀Setters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
4365 |
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 | <div class="description">
|
4371 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the setters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which setters should be injected.</p>
|
4372 | </div>
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 | <dl class="details">
|
4379 |
|
4380 |
|
4381 |
|
4382 |
|
4383 | <dt class="tag-since">Since:</dt>
|
4384 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
4385 |
|
4386 |
|
4387 |
|
4388 |
|
4389 |
|
4390 |
|
4391 |
|
4392 |
|
4393 |
|
4394 |
|
4395 |
|
4396 |
|
4397 |
|
4398 |
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 | <dt class="tag-source">Source:</dt>
|
4409 | <dd class="tag-source"><ul class="dummy"><li>
|
4410 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line381">line 381</a>
|
4411 | </li></ul></dd>
|
4412 |
|
4413 |
|
4414 |
|
4415 |
|
4416 |
|
4417 |
|
4418 |
|
4419 | </dl>
|
4420 |
|
4421 |
|
4422 |
|
4423 |
|
4424 |
|
4425 |
|
4426 |
|
4427 |
|
4428 |
|
4429 | <h5>Parameters:</h5>
|
4430 |
|
4431 |
|
4432 | <table class="params">
|
4433 | <thead>
|
4434 | <tr>
|
4435 |
|
4436 | <th>Name</th>
|
4437 |
|
4438 |
|
4439 | <th>Type</th>
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 | <th class="last">Description</th>
|
4446 | </tr>
|
4447 | </thead>
|
4448 |
|
4449 | <tbody>
|
4450 |
|
4451 |
|
4452 | <tr>
|
4453 |
|
4454 | <td class="name"><code>propertyNames</code></td>
|
4455 |
|
4456 |
|
4457 | <td class="type">
|
4458 |
|
4459 |
|
4460 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
4461 |
|
4462 |
|
4463 |
|
4464 | </td>
|
4465 |
|
4466 |
|
4467 |
|
4468 |
|
4469 |
|
4470 | <td class="description last">
|
4471 | <p>if the model has<br>'name' and 'age' as properties, then passing those two strings will<br>result in setters that surface those properties as GraphQL fields.</p>
|
4472 |
|
4473 | </td>
|
4474 | </tr>
|
4475 |
|
4476 |
|
4477 | </tbody>
|
4478 | </table>
|
4479 |
|
4480 |
|
4481 |
|
4482 |
|
4483 |
|
4484 |
|
4485 |
|
4486 |
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 | <div class="section-returns">
|
4494 | <h5>Returns:</h5>
|
4495 |
|
4496 |
|
4497 |
|
4498 | <dl class="param-type">
|
4499 | <dt>
|
4500 | Type:
|
4501 | </dt>
|
4502 | <dd>
|
4503 |
|
4504 | <span class="param-type"><code>function</code></span>
|
4505 |
|
4506 |
|
4507 | </dd>
|
4508 | </dl>
|
4509 |
|
4510 |
|
4511 | <div class="param-desc">
|
4512 | <p>a class decorator method</p>
|
4513 | </div>
|
4514 |
|
4515 |
|
4516 | </div>
|
4517 |
|
4518 |
|
4519 |
|
4520 | </div>
|
4521 |
|
4522 |
|
4523 | <div class="section-method">
|
4524 |
|
4525 |
|
4526 |
|
4527 | <h4 class="name" id="~decorate"><span class="type-signature">(inner) </span>decorate<span class="signature">(metaProperty, target, key, descriptor)</span><span class="type-signature"></span></h4>
|
4528 |
|
4529 |
|
4530 |
|
4531 |
|
4532 |
|
4533 | <div class="description">
|
4534 | <p>Since the bulk functionality of @subscriptor, @mutator and</p>
|
4535 | </div>
|
4536 |
|
4537 |
|
4538 |
|
4539 |
|
4540 |
|
4541 | <dl class="details">
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 |
|
4556 |
|
4557 |
|
4558 |
|
4559 |
|
4560 |
|
4561 |
|
4562 |
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 |
|
4568 | <dt class="tag-source">Source:</dt>
|
4569 | <dd class="tag-source"><ul class="dummy"><li>
|
4570 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line7">line 7</a>
|
4571 | </li></ul></dd>
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 |
|
4578 |
|
4579 | </dl>
|
4580 |
|
4581 |
|
4582 |
|
4583 |
|
4584 |
|
4585 |
|
4586 |
|
4587 |
|
4588 |
|
4589 | <h5>Parameters:</h5>
|
4590 |
|
4591 |
|
4592 | <table class="params">
|
4593 | <thead>
|
4594 | <tr>
|
4595 |
|
4596 | <th>Name</th>
|
4597 |
|
4598 |
|
4599 | <th>Type</th>
|
4600 |
|
4601 |
|
4602 |
|
4603 |
|
4604 |
|
4605 | <th class="last">Description</th>
|
4606 | </tr>
|
4607 | </thead>
|
4608 |
|
4609 | <tbody>
|
4610 |
|
4611 |
|
4612 | <tr>
|
4613 |
|
4614 | <td class="name"><code>metaProperty</code></td>
|
4615 |
|
4616 |
|
4617 | <td class="type">
|
4618 |
|
4619 |
|
4620 | <span class="param-type"><code>string</code></span>
|
4621 |
|
4622 |
|
4623 |
|
4624 | </td>
|
4625 |
|
4626 |
|
4627 |
|
4628 |
|
4629 |
|
4630 | <td class="description last">
|
4631 | <p>the name of the meta sub key under which to<br>store the modified decorated function.</p>
|
4632 |
|
4633 | </td>
|
4634 | </tr>
|
4635 |
|
4636 |
|
4637 |
|
4638 | <tr>
|
4639 |
|
4640 | <td class="name"><code>target</code></td>
|
4641 |
|
4642 |
|
4643 | <td class="type">
|
4644 |
|
4645 |
|
4646 | <span class="param-type"><code>Object</code></span>
|
4647 | |
|
4648 |
|
4649 | <span class="param-type"><code>function</code></span>
|
4650 |
|
4651 |
|
4652 |
|
4653 | </td>
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 |
|
4659 | <td class="description last">
|
4660 | <p>either the Class itself, if defined<br>on a static method, or the prototype if defined on an instance method</p>
|
4661 |
|
4662 | </td>
|
4663 | </tr>
|
4664 |
|
4665 |
|
4666 |
|
4667 | <tr>
|
4668 |
|
4669 | <td class="name"><code>key</code></td>
|
4670 |
|
4671 |
|
4672 | <td class="type">
|
4673 |
|
4674 |
|
4675 | <span class="param-type"><code>string</code></span>
|
4676 |
|
4677 |
|
4678 |
|
4679 | </td>
|
4680 |
|
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 | <td class="description last">
|
4686 | <p>the property name of the function being decorated</p>
|
4687 |
|
4688 | </td>
|
4689 | </tr>
|
4690 |
|
4691 |
|
4692 |
|
4693 | <tr>
|
4694 |
|
4695 | <td class="name"><code>descriptor</code></td>
|
4696 |
|
4697 |
|
4698 | <td class="type">
|
4699 |
|
4700 |
|
4701 | <span class="param-type"><code>Object</code></span>
|
4702 |
|
4703 |
|
4704 |
|
4705 | </td>
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 | <td class="description last">
|
4712 | <p>a decorator descriptor; see<br><code>Object.defineProperty</code> for more information on descriptors</p>
|
4713 |
|
4714 | </td>
|
4715 | </tr>
|
4716 |
|
4717 |
|
4718 | </tbody>
|
4719 | </table>
|
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 | </div>
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 | </article>
|
4744 |
|
4745 | </section>
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 | <section>
|
4754 |
|
4755 | <header>
|
4756 |
|
4757 | <h2>
|
4758 | decorators
|
4759 | </h2>
|
4760 |
|
4761 |
|
4762 | </header>
|
4763 |
|
4764 | <article>
|
4765 | <div class="container-overview">
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 |
|
4772 | <dl class="details">
|
4773 |
|
4774 |
|
4775 |
|
4776 |
|
4777 |
|
4778 |
|
4779 |
|
4780 |
|
4781 |
|
4782 |
|
4783 |
|
4784 |
|
4785 |
|
4786 |
|
4787 |
|
4788 |
|
4789 |
|
4790 |
|
4791 |
|
4792 |
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 |
|
4799 | <dt class="tag-source">Source:</dt>
|
4800 | <dd class="tag-source"><ul class="dummy"><li>
|
4801 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line61">line 61</a>
|
4802 | </li></ul></dd>
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 | </dl>
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 | </div>
|
4816 |
|
4817 |
|
4818 |
|
4819 |
|
4820 |
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 | <h3 class="subsection-title">Members</h3>
|
4829 |
|
4830 |
|
4831 |
|
4832 | <div class="section-members">
|
4833 | <h4 class="name" id=".DirectTypeManager"><span class="type-signature">(static, constant) </span>DirectTypeManager<span class="type-signature"> :Object</span></h4>
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 | <div class="description">
|
4839 | <p>A small suite of functions a getter that allows easy manipulation of the<br>the DIRECT_TYPES workaround needed for some types of complex class<br>wrapping allowed by the @Getters and @Properties decorators. Namely the<br>ability to do something like @Getters('name', String) which would wrap the<br>contents of whatever is in the objects model in a String call.</p>
|
4840 | <p>Direct types are those that need to be called without <code>new</code> in order for the<br>desired behavior to present itself.</p>
|
4841 | </div>
|
4842 |
|
4843 |
|
4844 |
|
4845 |
|
4846 |
|
4847 | <dl class="details">
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 | <dt class="tag-since">Since:</dt>
|
4853 | <dd class="tag-since"><ul class="dummy"><li>2.7.0</li></ul></dd>
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 |
|
4860 |
|
4861 |
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 |
|
4877 | <dt class="tag-source">Source:</dt>
|
4878 | <dd class="tag-source"><ul class="dummy"><li>
|
4879 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line214">line 214</a>
|
4880 | </li></ul></dd>
|
4881 |
|
4882 |
|
4883 |
|
4884 |
|
4885 |
|
4886 |
|
4887 |
|
4888 | </dl>
|
4889 |
|
4890 |
|
4891 |
|
4892 | <h5>Type:</h5>
|
4893 | <ul>
|
4894 | <li>
|
4895 |
|
4896 | <span class="param-type"><code>Object</code></span>
|
4897 |
|
4898 |
|
4899 | </li>
|
4900 | </ul>
|
4901 |
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 | </div>
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 | <h3 class="subsection-title">Methods</h3>
|
4913 |
|
4914 |
|
4915 |
|
4916 | <div class="section-method">
|
4917 |
|
4918 |
|
4919 |
|
4920 | <h4 class="name" id=".%E2%8C%BE%E2%A0%80extractBits"><span class="type-signature">(static) </span>⌾⠀extractBits<span class="signature">(property)</span><span class="type-signature"> → {Object}</span></h4>
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 |
|
4926 | <div class="description">
|
4927 | <p>For each of the decorators, Getters, Setters, and Properties, we take a<br>list of property names used to create the appropriate accessor types. In<br>some cases, however, the instance of GQLBase's data model may have a<br>different name. Finally if the return type for the getter should be wrapped<br>in a another GQLBase class type, we will need a way to specify those things<br>too.</p>
|
4928 | <p>The <code>extractBits()</code> takes a single argument value from the decorator as it<br>parses them and converts it into an object, properly sorted, into values that<br>allow the above described behavior.</p>
|
4929 | <p>Examples:</p>
|
4930 | <p>```<br>// Create a class with a name and age property that map directly to the<br>// underlying data model</p>
|
4931 | </div>
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 | <dl class="details">
|
4938 |
|
4939 |
|
4940 |
|
4941 |
|
4942 | <dt class="tag-since">Since:</dt>
|
4943 | <dd class="tag-since"><ul class="dummy"><li>2.5</li></ul></dd>
|
4944 |
|
4945 |
|
4946 |
|
4947 |
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 |
|
4955 |
|
4956 |
|
4957 |
|
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 | <dt class="tag-source">Source:</dt>
|
4968 | <dd class="tag-source"><ul class="dummy"><li>
|
4969 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line11">line 11</a>
|
4970 | </li></ul></dd>
|
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 |
|
4978 | </dl>
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 |
|
4988 | <h5>Parameters:</h5>
|
4989 |
|
4990 |
|
4991 | <table class="params">
|
4992 | <thead>
|
4993 | <tr>
|
4994 |
|
4995 | <th>Name</th>
|
4996 |
|
4997 |
|
4998 | <th>Type</th>
|
4999 |
|
5000 |
|
5001 |
|
5002 |
|
5003 |
|
5004 | <th class="last">Description</th>
|
5005 | </tr>
|
5006 | </thead>
|
5007 |
|
5008 | <tbody>
|
5009 |
|
5010 |
|
5011 | <tr>
|
5012 |
|
5013 | <td class="name"><code>property</code></td>
|
5014 |
|
5015 |
|
5016 | <td class="type">
|
5017 |
|
5018 |
|
5019 | <span class="param-type"><code>String</code></span>
|
5020 | |
|
5021 |
|
5022 | <span class="param-type"><code>Array.<(String|function())></code></span>
|
5023 |
|
5024 |
|
5025 |
|
5026 | </td>
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 | <td class="description last">
|
5033 | <p>name of a property, or list<br>of property names and a Class.</p>
|
5034 |
|
5035 | </td>
|
5036 | </tr>
|
5037 |
|
5038 |
|
5039 | </tbody>
|
5040 | </table>
|
5041 |
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 |
|
5054 |
|
5055 | <div class="section-returns">
|
5056 | <h5>Returns:</h5>
|
5057 |
|
5058 |
|
5059 |
|
5060 | <dl class="param-type">
|
5061 | <dt>
|
5062 | Type:
|
5063 | </dt>
|
5064 | <dd>
|
5065 |
|
5066 | <span class="param-type"><code>Object</code></span>
|
5067 |
|
5068 |
|
5069 | </dd>
|
5070 | </dl>
|
5071 |
|
5072 |
|
5073 | <div class="param-desc">
|
5074 | <p>an object with the following format <code>{
|
5075 | fieldName: name of root instance property to create
|
5076 | modelName: name of its associated internal model property
|
5077 | typeClass: an optional class to wrap around the results in a getter
|
5078 | }</code></p>
|
5079 | </div>
|
5080 |
|
5081 |
|
5082 | </div>
|
5083 |
|
5084 |
|
5085 |
|
5086 | </div>
|
5087 |
|
5088 |
|
5089 | <div class="section-method">
|
5090 |
|
5091 |
|
5092 |
|
5093 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80AdjacentSchema"><span class="type-signature">(static) </span>.🏷⠀AdjacentSchema<span class="signature">(object, property, descriptor)</span><span class="type-signature"></span></h4>
|
5094 |
|
5095 |
|
5096 |
|
5097 |
|
5098 |
|
5099 | <div class="description">
|
5100 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
5101 | </div>
|
5102 |
|
5103 |
|
5104 |
|
5105 |
|
5106 |
|
5107 | <dl class="details">
|
5108 |
|
5109 |
|
5110 |
|
5111 |
|
5112 | <dt class="tag-since">Since:</dt>
|
5113 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 | <dt class="tag-source">Source:</dt>
|
5138 | <dd class="tag-source"><ul class="dummy"><li>
|
5139 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line6">line 6</a>
|
5140 | </li></ul></dd>
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 | </dl>
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 | <h5>Parameters:</h5>
|
5159 |
|
5160 |
|
5161 | <table class="params">
|
5162 | <thead>
|
5163 | <tr>
|
5164 |
|
5165 | <th>Name</th>
|
5166 |
|
5167 |
|
5168 | <th>Type</th>
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 | <th class="last">Description</th>
|
5175 | </tr>
|
5176 | </thead>
|
5177 |
|
5178 | <tbody>
|
5179 |
|
5180 |
|
5181 | <tr>
|
5182 |
|
5183 | <td class="name"><code>object</code></td>
|
5184 |
|
5185 |
|
5186 | <td class="type">
|
5187 |
|
5188 |
|
5189 | <span class="param-type"><code>mixed</code></span>
|
5190 |
|
5191 |
|
5192 |
|
5193 | </td>
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 | <td class="description last">
|
5200 | <p>the object on which to apply the decorator</p>
|
5201 |
|
5202 | </td>
|
5203 | </tr>
|
5204 |
|
5205 |
|
5206 |
|
5207 | <tr>
|
5208 |
|
5209 | <td class="name"><code>property</code></td>
|
5210 |
|
5211 |
|
5212 | <td class="type">
|
5213 |
|
5214 |
|
5215 | <span class="param-type"><code>String</code></span>
|
5216 |
|
5217 |
|
5218 |
|
5219 | </td>
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 | <td class="description last">
|
5226 | <p>the name of the object or property to<br>which the decorator is being applied.</p>
|
5227 |
|
5228 | </td>
|
5229 | </tr>
|
5230 |
|
5231 |
|
5232 |
|
5233 | <tr>
|
5234 |
|
5235 | <td class="name"><code>descriptor</code></td>
|
5236 |
|
5237 |
|
5238 | <td class="type">
|
5239 |
|
5240 |
|
5241 | <span class="param-type"><code>Object</code></span>
|
5242 |
|
5243 |
|
5244 |
|
5245 | </td>
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 | <td class="description last">
|
5252 | <p>a standard Object.defineProperty style<br>descriptor object.</p>
|
5253 |
|
5254 | </td>
|
5255 | </tr>
|
5256 |
|
5257 |
|
5258 | </tbody>
|
5259 | </table>
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 | </div>
|
5277 |
|
5278 |
|
5279 | <div class="section-method">
|
5280 |
|
5281 |
|
5282 |
|
5283 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80FileSchema"><span class="type-signature">(static) </span>.🏷⠀FileSchema<span class="signature">(path, extension)</span><span class="type-signature"> → {mixed}</span></h4>
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 |
|
5289 | <div class="description">
|
5290 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
5291 | </div>
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 | <dl class="details">
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 | <dt class="tag-since">Since:</dt>
|
5303 | <dd class="tag-since"><ul class="dummy"><li>2.3.0</li></ul></dd>
|
5304 |
|
5305 |
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 |
|
5313 |
|
5314 |
|
5315 |
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 | <dt class="tag-source">Source:</dt>
|
5328 | <dd class="tag-source"><ul class="dummy"><li>
|
5329 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line6">line 6</a>
|
5330 | </li></ul></dd>
|
5331 |
|
5332 |
|
5333 |
|
5334 |
|
5335 |
|
5336 |
|
5337 |
|
5338 | </dl>
|
5339 |
|
5340 |
|
5341 |
|
5342 |
|
5343 |
|
5344 |
|
5345 |
|
5346 |
|
5347 |
|
5348 | <h5>Parameters:</h5>
|
5349 |
|
5350 |
|
5351 | <table class="params">
|
5352 | <thead>
|
5353 | <tr>
|
5354 |
|
5355 | <th>Name</th>
|
5356 |
|
5357 |
|
5358 | <th>Type</th>
|
5359 |
|
5360 |
|
5361 |
|
5362 |
|
5363 |
|
5364 | <th class="last">Description</th>
|
5365 | </tr>
|
5366 | </thead>
|
5367 |
|
5368 | <tbody>
|
5369 |
|
5370 |
|
5371 | <tr>
|
5372 |
|
5373 | <td class="name"><code>path</code></td>
|
5374 |
|
5375 |
|
5376 | <td class="type">
|
5377 |
|
5378 |
|
5379 | <span class="param-type"><code>String</code></span>
|
5380 |
|
5381 |
|
5382 |
|
5383 | </td>
|
5384 |
|
5385 |
|
5386 |
|
5387 |
|
5388 |
|
5389 | <td class="description last">
|
5390 | <p>a relative or absolute path to the file containing<br>your GraphQL IDL schema portion for your object type.</p>
|
5391 |
|
5392 | </td>
|
5393 | </tr>
|
5394 |
|
5395 |
|
5396 |
|
5397 | <tr>
|
5398 |
|
5399 | <td class="name"><code>extension</code></td>
|
5400 |
|
5401 |
|
5402 | <td class="type">
|
5403 |
|
5404 |
|
5405 | <span class="param-type"><code>String</code></span>
|
5406 |
|
5407 |
|
5408 |
|
5409 | </td>
|
5410 |
|
5411 |
|
5412 |
|
5413 |
|
5414 |
|
5415 | <td class="description last">
|
5416 | <p>the extension of the graphql schema file pointed<br>to in the previous parameter. By default these are <code>".graphql"</code> but should<br>your path point to a file with a different extension, you should specify<br>that extension here.</p>
|
5417 |
|
5418 | </td>
|
5419 | </tr>
|
5420 |
|
5421 |
|
5422 | </tbody>
|
5423 | </table>
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 |
|
5433 |
|
5434 |
|
5435 |
|
5436 |
|
5437 |
|
5438 | <div class="section-returns">
|
5439 | <h5>Returns:</h5>
|
5440 |
|
5441 |
|
5442 |
|
5443 | <dl class="param-type">
|
5444 | <dt>
|
5445 | Type:
|
5446 | </dt>
|
5447 | <dd>
|
5448 |
|
5449 | <span class="param-type"><code>mixed</code></span>
|
5450 |
|
5451 |
|
5452 | </dd>
|
5453 | </dl>
|
5454 |
|
5455 |
|
5456 | <div class="param-desc">
|
5457 | <p>as per all class decorators, <code>FileSchema</code> returns the<br>class object being modified</p>
|
5458 | </div>
|
5459 |
|
5460 |
|
5461 | </div>
|
5462 |
|
5463 |
|
5464 |
|
5465 | </div>
|
5466 |
|
5467 |
|
5468 | <div class="section-method">
|
5469 |
|
5470 |
|
5471 |
|
5472 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Getters"><span class="type-signature">(static) </span>.🏷⠀Getters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
5473 |
|
5474 |
|
5475 |
|
5476 |
|
5477 |
|
5478 | <div class="description">
|
5479 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
5480 | </div>
|
5481 |
|
5482 |
|
5483 |
|
5484 |
|
5485 |
|
5486 | <dl class="details">
|
5487 |
|
5488 |
|
5489 |
|
5490 |
|
5491 |
|
5492 |
|
5493 |
|
5494 |
|
5495 |
|
5496 |
|
5497 |
|
5498 |
|
5499 |
|
5500 |
|
5501 |
|
5502 |
|
5503 |
|
5504 |
|
5505 |
|
5506 |
|
5507 |
|
5508 |
|
5509 |
|
5510 |
|
5511 |
|
5512 |
|
5513 | <dt class="tag-source">Source:</dt>
|
5514 | <dd class="tag-source"><ul class="dummy"><li>
|
5515 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line337">line 337</a>
|
5516 | </li></ul></dd>
|
5517 |
|
5518 |
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 |
|
5524 | </dl>
|
5525 |
|
5526 |
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 |
|
5533 |
|
5534 | <h5>Parameters:</h5>
|
5535 |
|
5536 |
|
5537 | <table class="params">
|
5538 | <thead>
|
5539 | <tr>
|
5540 |
|
5541 | <th>Name</th>
|
5542 |
|
5543 |
|
5544 | <th>Type</th>
|
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 | <th class="last">Description</th>
|
5551 | </tr>
|
5552 | </thead>
|
5553 |
|
5554 | <tbody>
|
5555 |
|
5556 |
|
5557 | <tr>
|
5558 |
|
5559 | <td class="name"><code>propertyNames</code></td>
|
5560 |
|
5561 |
|
5562 | <td class="type">
|
5563 |
|
5564 |
|
5565 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
5566 |
|
5567 |
|
5568 |
|
5569 | </td>
|
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 | <td class="description last">
|
5576 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters that surface those properties as GraphQL fields.</p>
|
5577 |
|
5578 | </td>
|
5579 | </tr>
|
5580 |
|
5581 |
|
5582 | </tbody>
|
5583 | </table>
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 |
|
5594 |
|
5595 |
|
5596 |
|
5597 |
|
5598 | <div class="section-returns">
|
5599 | <h5>Returns:</h5>
|
5600 |
|
5601 |
|
5602 |
|
5603 | <dl class="param-type">
|
5604 | <dt>
|
5605 | Type:
|
5606 | </dt>
|
5607 | <dd>
|
5608 |
|
5609 | <span class="param-type"><code>function</code></span>
|
5610 |
|
5611 |
|
5612 | </dd>
|
5613 | </dl>
|
5614 |
|
5615 |
|
5616 | <div class="param-desc">
|
5617 | <p>a class decorator method.s</p>
|
5618 | </div>
|
5619 |
|
5620 |
|
5621 | </div>
|
5622 |
|
5623 |
|
5624 |
|
5625 | </div>
|
5626 |
|
5627 |
|
5628 | <div class="section-method">
|
5629 |
|
5630 |
|
5631 |
|
5632 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Properties"><span class="type-signature">(static) </span>.🏷⠀Properties<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
5633 |
|
5634 |
|
5635 |
|
5636 |
|
5637 |
|
5638 | <div class="description">
|
5639 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
5640 | <p>This method creates both getters and setters</p>
|
5641 | </div>
|
5642 |
|
5643 |
|
5644 |
|
5645 |
|
5646 |
|
5647 | <dl class="details">
|
5648 |
|
5649 |
|
5650 |
|
5651 |
|
5652 | <dt class="tag-since">Since:</dt>
|
5653 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
5654 |
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 |
|
5664 |
|
5665 |
|
5666 |
|
5667 |
|
5668 |
|
5669 |
|
5670 |
|
5671 |
|
5672 |
|
5673 |
|
5674 |
|
5675 |
|
5676 |
|
5677 | <dt class="tag-source">Source:</dt>
|
5678 | <dd class="tag-source"><ul class="dummy"><li>
|
5679 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line426">line 426</a>
|
5680 | </li></ul></dd>
|
5681 |
|
5682 |
|
5683 |
|
5684 |
|
5685 |
|
5686 |
|
5687 |
|
5688 | </dl>
|
5689 |
|
5690 |
|
5691 |
|
5692 |
|
5693 |
|
5694 |
|
5695 |
|
5696 |
|
5697 |
|
5698 | <h5>Parameters:</h5>
|
5699 |
|
5700 |
|
5701 | <table class="params">
|
5702 | <thead>
|
5703 | <tr>
|
5704 |
|
5705 | <th>Name</th>
|
5706 |
|
5707 |
|
5708 | <th>Type</th>
|
5709 |
|
5710 |
|
5711 |
|
5712 |
|
5713 |
|
5714 | <th class="last">Description</th>
|
5715 | </tr>
|
5716 | </thead>
|
5717 |
|
5718 | <tbody>
|
5719 |
|
5720 |
|
5721 | <tr>
|
5722 |
|
5723 | <td class="name"><code>propertyNames</code></td>
|
5724 |
|
5725 |
|
5726 | <td class="type">
|
5727 |
|
5728 |
|
5729 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
5730 |
|
5731 |
|
5732 |
|
5733 | </td>
|
5734 |
|
5735 |
|
5736 |
|
5737 |
|
5738 |
|
5739 | <td class="description last">
|
5740 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters and setters that surface those properties as GraphQL fields.</p>
|
5741 |
|
5742 | </td>
|
5743 | </tr>
|
5744 |
|
5745 |
|
5746 | </tbody>
|
5747 | </table>
|
5748 |
|
5749 |
|
5750 |
|
5751 |
|
5752 |
|
5753 |
|
5754 |
|
5755 |
|
5756 |
|
5757 |
|
5758 |
|
5759 |
|
5760 |
|
5761 |
|
5762 | <div class="section-returns">
|
5763 | <h5>Returns:</h5>
|
5764 |
|
5765 |
|
5766 |
|
5767 | <dl class="param-type">
|
5768 | <dt>
|
5769 | Type:
|
5770 | </dt>
|
5771 | <dd>
|
5772 |
|
5773 | <span class="param-type"><code>function</code></span>
|
5774 |
|
5775 |
|
5776 | </dd>
|
5777 | </dl>
|
5778 |
|
5779 |
|
5780 | <div class="param-desc">
|
5781 | <p>a class decorator method</p>
|
5782 | </div>
|
5783 |
|
5784 |
|
5785 | </div>
|
5786 |
|
5787 |
|
5788 |
|
5789 | </div>
|
5790 |
|
5791 |
|
5792 | <div class="section-method">
|
5793 |
|
5794 |
|
5795 |
|
5796 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Schema"><span class="type-signature">(static) </span>.🏷⠀Schema<span class="signature">(schemaString)</span><span class="type-signature"></span></h4>
|
5797 |
|
5798 |
|
5799 |
|
5800 |
|
5801 |
|
5802 | <div class="description">
|
5803 | <p>This decorator allows you to specify the SCHEMA getter and associated<br>string as a parameter to the decorator itself. So, for example:</p>
|
5804 | <p><code></p>
|
5805 | </div>
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 | <dl class="details">
|
5812 |
|
5813 |
|
5814 |
|
5815 |
|
5816 | <dt class="tag-since">Since:</dt>
|
5817 | <dd class="tag-since"><ul class="dummy"><li>2.2.0</li></ul></dd>
|
5818 |
|
5819 |
|
5820 |
|
5821 |
|
5822 |
|
5823 |
|
5824 |
|
5825 |
|
5826 |
|
5827 |
|
5828 |
|
5829 |
|
5830 |
|
5831 |
|
5832 |
|
5833 |
|
5834 |
|
5835 |
|
5836 |
|
5837 |
|
5838 |
|
5839 |
|
5840 |
|
5841 | <dt class="tag-source">Source:</dt>
|
5842 | <dd class="tag-source"><ul class="dummy"><li>
|
5843 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line4">line 4</a>
|
5844 | </li></ul></dd>
|
5845 |
|
5846 |
|
5847 |
|
5848 |
|
5849 |
|
5850 |
|
5851 |
|
5852 | </dl>
|
5853 |
|
5854 |
|
5855 |
|
5856 |
|
5857 |
|
5858 |
|
5859 |
|
5860 |
|
5861 |
|
5862 | <h5>Parameters:</h5>
|
5863 |
|
5864 |
|
5865 | <table class="params">
|
5866 | <thead>
|
5867 | <tr>
|
5868 |
|
5869 | <th>Name</th>
|
5870 |
|
5871 |
|
5872 | <th>Type</th>
|
5873 |
|
5874 |
|
5875 |
|
5876 |
|
5877 |
|
5878 | <th class="last">Description</th>
|
5879 | </tr>
|
5880 | </thead>
|
5881 |
|
5882 | <tbody>
|
5883 |
|
5884 |
|
5885 | <tr>
|
5886 |
|
5887 | <td class="name"><code>schemaString</code></td>
|
5888 |
|
5889 |
|
5890 | <td class="type">
|
5891 |
|
5892 |
|
5893 | <span class="param-type"><code>string</code></span>
|
5894 |
|
5895 |
|
5896 |
|
5897 | </td>
|
5898 |
|
5899 |
|
5900 |
|
5901 |
|
5902 |
|
5903 | <td class="description last">
|
5904 | <p>a GraphQL IDL compliant string for defining a<br>GraphQL Object Schema.</p>
|
5905 |
|
5906 | </td>
|
5907 | </tr>
|
5908 |
|
5909 |
|
5910 | </tbody>
|
5911 | </table>
|
5912 |
|
5913 |
|
5914 |
|
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 |
|
5920 |
|
5921 |
|
5922 |
|
5923 |
|
5924 |
|
5925 |
|
5926 |
|
5927 |
|
5928 | </div>
|
5929 |
|
5930 |
|
5931 | <div class="section-method">
|
5932 |
|
5933 |
|
5934 |
|
5935 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Setters"><span class="type-signature">(static) </span>.🏷⠀Setters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
5936 |
|
5937 |
|
5938 |
|
5939 |
|
5940 |
|
5941 | <div class="description">
|
5942 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the setters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which setters should be injected.</p>
|
5943 | </div>
|
5944 |
|
5945 |
|
5946 |
|
5947 |
|
5948 |
|
5949 | <dl class="details">
|
5950 |
|
5951 |
|
5952 |
|
5953 |
|
5954 | <dt class="tag-since">Since:</dt>
|
5955 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
5956 |
|
5957 |
|
5958 |
|
5959 |
|
5960 |
|
5961 |
|
5962 |
|
5963 |
|
5964 |
|
5965 |
|
5966 |
|
5967 |
|
5968 |
|
5969 |
|
5970 |
|
5971 |
|
5972 |
|
5973 |
|
5974 |
|
5975 |
|
5976 |
|
5977 |
|
5978 |
|
5979 | <dt class="tag-source">Source:</dt>
|
5980 | <dd class="tag-source"><ul class="dummy"><li>
|
5981 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line381">line 381</a>
|
5982 | </li></ul></dd>
|
5983 |
|
5984 |
|
5985 |
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 | </dl>
|
5991 |
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 | <h5>Parameters:</h5>
|
6001 |
|
6002 |
|
6003 | <table class="params">
|
6004 | <thead>
|
6005 | <tr>
|
6006 |
|
6007 | <th>Name</th>
|
6008 |
|
6009 |
|
6010 | <th>Type</th>
|
6011 |
|
6012 |
|
6013 |
|
6014 |
|
6015 |
|
6016 | <th class="last">Description</th>
|
6017 | </tr>
|
6018 | </thead>
|
6019 |
|
6020 | <tbody>
|
6021 |
|
6022 |
|
6023 | <tr>
|
6024 |
|
6025 | <td class="name"><code>propertyNames</code></td>
|
6026 |
|
6027 |
|
6028 | <td class="type">
|
6029 |
|
6030 |
|
6031 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
6032 |
|
6033 |
|
6034 |
|
6035 | </td>
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 | <td class="description last">
|
6042 | <p>if the model has<br>'name' and 'age' as properties, then passing those two strings will<br>result in setters that surface those properties as GraphQL fields.</p>
|
6043 |
|
6044 | </td>
|
6045 | </tr>
|
6046 |
|
6047 |
|
6048 | </tbody>
|
6049 | </table>
|
6050 |
|
6051 |
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 |
|
6058 |
|
6059 |
|
6060 |
|
6061 |
|
6062 |
|
6063 |
|
6064 | <div class="section-returns">
|
6065 | <h5>Returns:</h5>
|
6066 |
|
6067 |
|
6068 |
|
6069 | <dl class="param-type">
|
6070 | <dt>
|
6071 | Type:
|
6072 | </dt>
|
6073 | <dd>
|
6074 |
|
6075 | <span class="param-type"><code>function</code></span>
|
6076 |
|
6077 |
|
6078 | </dd>
|
6079 | </dl>
|
6080 |
|
6081 |
|
6082 | <div class="param-desc">
|
6083 | <p>a class decorator method</p>
|
6084 | </div>
|
6085 |
|
6086 |
|
6087 | </div>
|
6088 |
|
6089 |
|
6090 |
|
6091 | </div>
|
6092 |
|
6093 |
|
6094 | <div class="section-method">
|
6095 |
|
6096 |
|
6097 |
|
6098 | <h4 class="name" id="~decorate"><span class="type-signature">(inner) </span>decorate<span class="signature">(metaProperty, target, key, descriptor)</span><span class="type-signature"></span></h4>
|
6099 |
|
6100 |
|
6101 |
|
6102 |
|
6103 |
|
6104 | <div class="description">
|
6105 | <p>Since the bulk functionality of @subscriptor, @mutator and</p>
|
6106 | </div>
|
6107 |
|
6108 |
|
6109 |
|
6110 |
|
6111 |
|
6112 | <dl class="details">
|
6113 |
|
6114 |
|
6115 |
|
6116 |
|
6117 |
|
6118 |
|
6119 |
|
6120 |
|
6121 |
|
6122 |
|
6123 |
|
6124 |
|
6125 |
|
6126 |
|
6127 |
|
6128 |
|
6129 |
|
6130 |
|
6131 |
|
6132 |
|
6133 |
|
6134 |
|
6135 |
|
6136 |
|
6137 |
|
6138 |
|
6139 | <dt class="tag-source">Source:</dt>
|
6140 | <dd class="tag-source"><ul class="dummy"><li>
|
6141 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line7">line 7</a>
|
6142 | </li></ul></dd>
|
6143 |
|
6144 |
|
6145 |
|
6146 |
|
6147 |
|
6148 |
|
6149 |
|
6150 | </dl>
|
6151 |
|
6152 |
|
6153 |
|
6154 |
|
6155 |
|
6156 |
|
6157 |
|
6158 |
|
6159 |
|
6160 | <h5>Parameters:</h5>
|
6161 |
|
6162 |
|
6163 | <table class="params">
|
6164 | <thead>
|
6165 | <tr>
|
6166 |
|
6167 | <th>Name</th>
|
6168 |
|
6169 |
|
6170 | <th>Type</th>
|
6171 |
|
6172 |
|
6173 |
|
6174 |
|
6175 |
|
6176 | <th class="last">Description</th>
|
6177 | </tr>
|
6178 | </thead>
|
6179 |
|
6180 | <tbody>
|
6181 |
|
6182 |
|
6183 | <tr>
|
6184 |
|
6185 | <td class="name"><code>metaProperty</code></td>
|
6186 |
|
6187 |
|
6188 | <td class="type">
|
6189 |
|
6190 |
|
6191 | <span class="param-type"><code>string</code></span>
|
6192 |
|
6193 |
|
6194 |
|
6195 | </td>
|
6196 |
|
6197 |
|
6198 |
|
6199 |
|
6200 |
|
6201 | <td class="description last">
|
6202 | <p>the name of the meta sub key under which to<br>store the modified decorated function.</p>
|
6203 |
|
6204 | </td>
|
6205 | </tr>
|
6206 |
|
6207 |
|
6208 |
|
6209 | <tr>
|
6210 |
|
6211 | <td class="name"><code>target</code></td>
|
6212 |
|
6213 |
|
6214 | <td class="type">
|
6215 |
|
6216 |
|
6217 | <span class="param-type"><code>Object</code></span>
|
6218 | |
|
6219 |
|
6220 | <span class="param-type"><code>function</code></span>
|
6221 |
|
6222 |
|
6223 |
|
6224 | </td>
|
6225 |
|
6226 |
|
6227 |
|
6228 |
|
6229 |
|
6230 | <td class="description last">
|
6231 | <p>either the Class itself, if defined<br>on a static method, or the prototype if defined on an instance method</p>
|
6232 |
|
6233 | </td>
|
6234 | </tr>
|
6235 |
|
6236 |
|
6237 |
|
6238 | <tr>
|
6239 |
|
6240 | <td class="name"><code>key</code></td>
|
6241 |
|
6242 |
|
6243 | <td class="type">
|
6244 |
|
6245 |
|
6246 | <span class="param-type"><code>string</code></span>
|
6247 |
|
6248 |
|
6249 |
|
6250 | </td>
|
6251 |
|
6252 |
|
6253 |
|
6254 |
|
6255 |
|
6256 | <td class="description last">
|
6257 | <p>the property name of the function being decorated</p>
|
6258 |
|
6259 | </td>
|
6260 | </tr>
|
6261 |
|
6262 |
|
6263 |
|
6264 | <tr>
|
6265 |
|
6266 | <td class="name"><code>descriptor</code></td>
|
6267 |
|
6268 |
|
6269 | <td class="type">
|
6270 |
|
6271 |
|
6272 | <span class="param-type"><code>Object</code></span>
|
6273 |
|
6274 |
|
6275 |
|
6276 | </td>
|
6277 |
|
6278 |
|
6279 |
|
6280 |
|
6281 |
|
6282 | <td class="description last">
|
6283 | <p>a decorator descriptor; see<br><code>Object.defineProperty</code> for more information on descriptors</p>
|
6284 |
|
6285 | </td>
|
6286 | </tr>
|
6287 |
|
6288 |
|
6289 | </tbody>
|
6290 | </table>
|
6291 |
|
6292 |
|
6293 |
|
6294 |
|
6295 |
|
6296 |
|
6297 |
|
6298 |
|
6299 |
|
6300 |
|
6301 |
|
6302 |
|
6303 |
|
6304 |
|
6305 |
|
6306 |
|
6307 | </div>
|
6308 |
|
6309 |
|
6310 |
|
6311 |
|
6312 |
|
6313 |
|
6314 | </article>
|
6315 |
|
6316 | </section>
|
6317 |
|
6318 |
|
6319 |
|
6320 |
|
6321 |
|
6322 |
|
6323 |
|
6324 | <section>
|
6325 |
|
6326 | <header>
|
6327 |
|
6328 | <h2>
|
6329 | decorators
|
6330 | </h2>
|
6331 |
|
6332 |
|
6333 | </header>
|
6334 |
|
6335 | <article>
|
6336 | <div class="container-overview">
|
6337 |
|
6338 |
|
6339 |
|
6340 |
|
6341 |
|
6342 |
|
6343 | <dl class="details">
|
6344 |
|
6345 |
|
6346 |
|
6347 |
|
6348 |
|
6349 |
|
6350 |
|
6351 |
|
6352 |
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 |
|
6358 |
|
6359 |
|
6360 |
|
6361 |
|
6362 |
|
6363 |
|
6364 |
|
6365 |
|
6366 |
|
6367 |
|
6368 |
|
6369 |
|
6370 | <dt class="tag-source">Source:</dt>
|
6371 | <dd class="tag-source"><ul class="dummy"><li>
|
6372 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line65">line 65</a>
|
6373 | </li></ul></dd>
|
6374 |
|
6375 |
|
6376 |
|
6377 |
|
6378 |
|
6379 |
|
6380 |
|
6381 | </dl>
|
6382 |
|
6383 |
|
6384 |
|
6385 |
|
6386 | </div>
|
6387 |
|
6388 |
|
6389 |
|
6390 |
|
6391 |
|
6392 |
|
6393 |
|
6394 |
|
6395 |
|
6396 |
|
6397 |
|
6398 |
|
6399 | <h3 class="subsection-title">Members</h3>
|
6400 |
|
6401 |
|
6402 |
|
6403 | <div class="section-members">
|
6404 | <h4 class="name" id=".DirectTypeManager"><span class="type-signature">(static, constant) </span>DirectTypeManager<span class="type-signature"> :Object</span></h4>
|
6405 |
|
6406 |
|
6407 |
|
6408 |
|
6409 | <div class="description">
|
6410 | <p>A small suite of functions a getter that allows easy manipulation of the<br>the DIRECT_TYPES workaround needed for some types of complex class<br>wrapping allowed by the @Getters and @Properties decorators. Namely the<br>ability to do something like @Getters('name', String) which would wrap the<br>contents of whatever is in the objects model in a String call.</p>
|
6411 | <p>Direct types are those that need to be called without <code>new</code> in order for the<br>desired behavior to present itself.</p>
|
6412 | </div>
|
6413 |
|
6414 |
|
6415 |
|
6416 |
|
6417 |
|
6418 | <dl class="details">
|
6419 |
|
6420 |
|
6421 |
|
6422 |
|
6423 | <dt class="tag-since">Since:</dt>
|
6424 | <dd class="tag-since"><ul class="dummy"><li>2.7.0</li></ul></dd>
|
6425 |
|
6426 |
|
6427 |
|
6428 |
|
6429 |
|
6430 |
|
6431 |
|
6432 |
|
6433 |
|
6434 |
|
6435 |
|
6436 |
|
6437 |
|
6438 |
|
6439 |
|
6440 |
|
6441 |
|
6442 |
|
6443 |
|
6444 |
|
6445 |
|
6446 |
|
6447 |
|
6448 | <dt class="tag-source">Source:</dt>
|
6449 | <dd class="tag-source"><ul class="dummy"><li>
|
6450 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line214">line 214</a>
|
6451 | </li></ul></dd>
|
6452 |
|
6453 |
|
6454 |
|
6455 |
|
6456 |
|
6457 |
|
6458 |
|
6459 | </dl>
|
6460 |
|
6461 |
|
6462 |
|
6463 | <h5>Type:</h5>
|
6464 | <ul>
|
6465 | <li>
|
6466 |
|
6467 | <span class="param-type"><code>Object</code></span>
|
6468 |
|
6469 |
|
6470 | </li>
|
6471 | </ul>
|
6472 |
|
6473 |
|
6474 |
|
6475 |
|
6476 |
|
6477 | </div>
|
6478 |
|
6479 |
|
6480 |
|
6481 |
|
6482 |
|
6483 | <h3 class="subsection-title">Methods</h3>
|
6484 |
|
6485 |
|
6486 |
|
6487 | <div class="section-method">
|
6488 |
|
6489 |
|
6490 |
|
6491 | <h4 class="name" id=".%E2%8C%BE%E2%A0%80extractBits"><span class="type-signature">(static) </span>⌾⠀extractBits<span class="signature">(property)</span><span class="type-signature"> → {Object}</span></h4>
|
6492 |
|
6493 |
|
6494 |
|
6495 |
|
6496 |
|
6497 | <div class="description">
|
6498 | <p>For each of the decorators, Getters, Setters, and Properties, we take a<br>list of property names used to create the appropriate accessor types. In<br>some cases, however, the instance of GQLBase's data model may have a<br>different name. Finally if the return type for the getter should be wrapped<br>in a another GQLBase class type, we will need a way to specify those things<br>too.</p>
|
6499 | <p>The <code>extractBits()</code> takes a single argument value from the decorator as it<br>parses them and converts it into an object, properly sorted, into values that<br>allow the above described behavior.</p>
|
6500 | <p>Examples:</p>
|
6501 | <p>```<br>// Create a class with a name and age property that map directly to the<br>// underlying data model</p>
|
6502 | </div>
|
6503 |
|
6504 |
|
6505 |
|
6506 |
|
6507 |
|
6508 | <dl class="details">
|
6509 |
|
6510 |
|
6511 |
|
6512 |
|
6513 | <dt class="tag-since">Since:</dt>
|
6514 | <dd class="tag-since"><ul class="dummy"><li>2.5</li></ul></dd>
|
6515 |
|
6516 |
|
6517 |
|
6518 |
|
6519 |
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 |
|
6525 |
|
6526 |
|
6527 |
|
6528 |
|
6529 |
|
6530 |
|
6531 |
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 | <dt class="tag-source">Source:</dt>
|
6539 | <dd class="tag-source"><ul class="dummy"><li>
|
6540 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line11">line 11</a>
|
6541 | </li></ul></dd>
|
6542 |
|
6543 |
|
6544 |
|
6545 |
|
6546 |
|
6547 |
|
6548 |
|
6549 | </dl>
|
6550 |
|
6551 |
|
6552 |
|
6553 |
|
6554 |
|
6555 |
|
6556 |
|
6557 |
|
6558 |
|
6559 | <h5>Parameters:</h5>
|
6560 |
|
6561 |
|
6562 | <table class="params">
|
6563 | <thead>
|
6564 | <tr>
|
6565 |
|
6566 | <th>Name</th>
|
6567 |
|
6568 |
|
6569 | <th>Type</th>
|
6570 |
|
6571 |
|
6572 |
|
6573 |
|
6574 |
|
6575 | <th class="last">Description</th>
|
6576 | </tr>
|
6577 | </thead>
|
6578 |
|
6579 | <tbody>
|
6580 |
|
6581 |
|
6582 | <tr>
|
6583 |
|
6584 | <td class="name"><code>property</code></td>
|
6585 |
|
6586 |
|
6587 | <td class="type">
|
6588 |
|
6589 |
|
6590 | <span class="param-type"><code>String</code></span>
|
6591 | |
|
6592 |
|
6593 | <span class="param-type"><code>Array.<(String|function())></code></span>
|
6594 |
|
6595 |
|
6596 |
|
6597 | </td>
|
6598 |
|
6599 |
|
6600 |
|
6601 |
|
6602 |
|
6603 | <td class="description last">
|
6604 | <p>name of a property, or list<br>of property names and a Class.</p>
|
6605 |
|
6606 | </td>
|
6607 | </tr>
|
6608 |
|
6609 |
|
6610 | </tbody>
|
6611 | </table>
|
6612 |
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 |
|
6618 |
|
6619 |
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 |
|
6625 |
|
6626 | <div class="section-returns">
|
6627 | <h5>Returns:</h5>
|
6628 |
|
6629 |
|
6630 |
|
6631 | <dl class="param-type">
|
6632 | <dt>
|
6633 | Type:
|
6634 | </dt>
|
6635 | <dd>
|
6636 |
|
6637 | <span class="param-type"><code>Object</code></span>
|
6638 |
|
6639 |
|
6640 | </dd>
|
6641 | </dl>
|
6642 |
|
6643 |
|
6644 | <div class="param-desc">
|
6645 | <p>an object with the following format <code>{
|
6646 | fieldName: name of root instance property to create
|
6647 | modelName: name of its associated internal model property
|
6648 | typeClass: an optional class to wrap around the results in a getter
|
6649 | }</code></p>
|
6650 | </div>
|
6651 |
|
6652 |
|
6653 | </div>
|
6654 |
|
6655 |
|
6656 |
|
6657 | </div>
|
6658 |
|
6659 |
|
6660 | <div class="section-method">
|
6661 |
|
6662 |
|
6663 |
|
6664 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80AdjacentSchema"><span class="type-signature">(static) </span>.🏷⠀AdjacentSchema<span class="signature">(object, property, descriptor)</span><span class="type-signature"></span></h4>
|
6665 |
|
6666 |
|
6667 |
|
6668 |
|
6669 |
|
6670 | <div class="description">
|
6671 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
6672 | </div>
|
6673 |
|
6674 |
|
6675 |
|
6676 |
|
6677 |
|
6678 | <dl class="details">
|
6679 |
|
6680 |
|
6681 |
|
6682 |
|
6683 | <dt class="tag-since">Since:</dt>
|
6684 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 |
|
6696 |
|
6697 |
|
6698 |
|
6699 |
|
6700 |
|
6701 |
|
6702 |
|
6703 |
|
6704 |
|
6705 |
|
6706 |
|
6707 |
|
6708 | <dt class="tag-source">Source:</dt>
|
6709 | <dd class="tag-source"><ul class="dummy"><li>
|
6710 | <a href="decorators_AdjacentSchema.js.html">decorators/AdjacentSchema.js</a>, <a href="decorators_AdjacentSchema.js.html#line6">line 6</a>
|
6711 | </li></ul></dd>
|
6712 |
|
6713 |
|
6714 |
|
6715 |
|
6716 |
|
6717 |
|
6718 |
|
6719 | </dl>
|
6720 |
|
6721 |
|
6722 |
|
6723 |
|
6724 |
|
6725 |
|
6726 |
|
6727 |
|
6728 |
|
6729 | <h5>Parameters:</h5>
|
6730 |
|
6731 |
|
6732 | <table class="params">
|
6733 | <thead>
|
6734 | <tr>
|
6735 |
|
6736 | <th>Name</th>
|
6737 |
|
6738 |
|
6739 | <th>Type</th>
|
6740 |
|
6741 |
|
6742 |
|
6743 |
|
6744 |
|
6745 | <th class="last">Description</th>
|
6746 | </tr>
|
6747 | </thead>
|
6748 |
|
6749 | <tbody>
|
6750 |
|
6751 |
|
6752 | <tr>
|
6753 |
|
6754 | <td class="name"><code>object</code></td>
|
6755 |
|
6756 |
|
6757 | <td class="type">
|
6758 |
|
6759 |
|
6760 | <span class="param-type"><code>mixed</code></span>
|
6761 |
|
6762 |
|
6763 |
|
6764 | </td>
|
6765 |
|
6766 |
|
6767 |
|
6768 |
|
6769 |
|
6770 | <td class="description last">
|
6771 | <p>the object on which to apply the decorator</p>
|
6772 |
|
6773 | </td>
|
6774 | </tr>
|
6775 |
|
6776 |
|
6777 |
|
6778 | <tr>
|
6779 |
|
6780 | <td class="name"><code>property</code></td>
|
6781 |
|
6782 |
|
6783 | <td class="type">
|
6784 |
|
6785 |
|
6786 | <span class="param-type"><code>String</code></span>
|
6787 |
|
6788 |
|
6789 |
|
6790 | </td>
|
6791 |
|
6792 |
|
6793 |
|
6794 |
|
6795 |
|
6796 | <td class="description last">
|
6797 | <p>the name of the object or property to<br>which the decorator is being applied.</p>
|
6798 |
|
6799 | </td>
|
6800 | </tr>
|
6801 |
|
6802 |
|
6803 |
|
6804 | <tr>
|
6805 |
|
6806 | <td class="name"><code>descriptor</code></td>
|
6807 |
|
6808 |
|
6809 | <td class="type">
|
6810 |
|
6811 |
|
6812 | <span class="param-type"><code>Object</code></span>
|
6813 |
|
6814 |
|
6815 |
|
6816 | </td>
|
6817 |
|
6818 |
|
6819 |
|
6820 |
|
6821 |
|
6822 | <td class="description last">
|
6823 | <p>a standard Object.defineProperty style<br>descriptor object.</p>
|
6824 |
|
6825 | </td>
|
6826 | </tr>
|
6827 |
|
6828 |
|
6829 | </tbody>
|
6830 | </table>
|
6831 |
|
6832 |
|
6833 |
|
6834 |
|
6835 |
|
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 |
|
6845 |
|
6846 |
|
6847 | </div>
|
6848 |
|
6849 |
|
6850 | <div class="section-method">
|
6851 |
|
6852 |
|
6853 |
|
6854 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80FileSchema"><span class="type-signature">(static) </span>.🏷⠀FileSchema<span class="signature">(path, extension)</span><span class="type-signature"> → {mixed}</span></h4>
|
6855 |
|
6856 |
|
6857 |
|
6858 |
|
6859 |
|
6860 | <div class="description">
|
6861 | <p>A decorator that does three things. First it defines the<br>module() static method that is required when using adjacent<br>schema files. Secondly, it defines a SCHEMA getter that<br>returns <code>GQLBase.ADJACENT_FILE</code>. Finally it sets a static<br>getter with the <code>Symbol</code>, <code>@adjacentSchema</code> so that other<br>can determine whether or not the decorator was used.</p>
|
6862 | </div>
|
6863 |
|
6864 |
|
6865 |
|
6866 |
|
6867 |
|
6868 | <dl class="details">
|
6869 |
|
6870 |
|
6871 |
|
6872 |
|
6873 | <dt class="tag-since">Since:</dt>
|
6874 | <dd class="tag-since"><ul class="dummy"><li>2.3.0</li></ul></dd>
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 |
|
6884 |
|
6885 |
|
6886 |
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 |
|
6896 |
|
6897 |
|
6898 | <dt class="tag-source">Source:</dt>
|
6899 | <dd class="tag-source"><ul class="dummy"><li>
|
6900 | <a href="decorators_FileSchema.js.html">decorators/FileSchema.js</a>, <a href="decorators_FileSchema.js.html#line6">line 6</a>
|
6901 | </li></ul></dd>
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 | </dl>
|
6910 |
|
6911 |
|
6912 |
|
6913 |
|
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 | <h5>Parameters:</h5>
|
6920 |
|
6921 |
|
6922 | <table class="params">
|
6923 | <thead>
|
6924 | <tr>
|
6925 |
|
6926 | <th>Name</th>
|
6927 |
|
6928 |
|
6929 | <th>Type</th>
|
6930 |
|
6931 |
|
6932 |
|
6933 |
|
6934 |
|
6935 | <th class="last">Description</th>
|
6936 | </tr>
|
6937 | </thead>
|
6938 |
|
6939 | <tbody>
|
6940 |
|
6941 |
|
6942 | <tr>
|
6943 |
|
6944 | <td class="name"><code>path</code></td>
|
6945 |
|
6946 |
|
6947 | <td class="type">
|
6948 |
|
6949 |
|
6950 | <span class="param-type"><code>String</code></span>
|
6951 |
|
6952 |
|
6953 |
|
6954 | </td>
|
6955 |
|
6956 |
|
6957 |
|
6958 |
|
6959 |
|
6960 | <td class="description last">
|
6961 | <p>a relative or absolute path to the file containing<br>your GraphQL IDL schema portion for your object type.</p>
|
6962 |
|
6963 | </td>
|
6964 | </tr>
|
6965 |
|
6966 |
|
6967 |
|
6968 | <tr>
|
6969 |
|
6970 | <td class="name"><code>extension</code></td>
|
6971 |
|
6972 |
|
6973 | <td class="type">
|
6974 |
|
6975 |
|
6976 | <span class="param-type"><code>String</code></span>
|
6977 |
|
6978 |
|
6979 |
|
6980 | </td>
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 | <td class="description last">
|
6987 | <p>the extension of the graphql schema file pointed<br>to in the previous parameter. By default these are <code>".graphql"</code> but should<br>your path point to a file with a different extension, you should specify<br>that extension here.</p>
|
6988 |
|
6989 | </td>
|
6990 | </tr>
|
6991 |
|
6992 |
|
6993 | </tbody>
|
6994 | </table>
|
6995 |
|
6996 |
|
6997 |
|
6998 |
|
6999 |
|
7000 |
|
7001 |
|
7002 |
|
7003 |
|
7004 |
|
7005 |
|
7006 |
|
7007 |
|
7008 |
|
7009 | <div class="section-returns">
|
7010 | <h5>Returns:</h5>
|
7011 |
|
7012 |
|
7013 |
|
7014 | <dl class="param-type">
|
7015 | <dt>
|
7016 | Type:
|
7017 | </dt>
|
7018 | <dd>
|
7019 |
|
7020 | <span class="param-type"><code>mixed</code></span>
|
7021 |
|
7022 |
|
7023 | </dd>
|
7024 | </dl>
|
7025 |
|
7026 |
|
7027 | <div class="param-desc">
|
7028 | <p>as per all class decorators, <code>FileSchema</code> returns the<br>class object being modified</p>
|
7029 | </div>
|
7030 |
|
7031 |
|
7032 | </div>
|
7033 |
|
7034 |
|
7035 |
|
7036 | </div>
|
7037 |
|
7038 |
|
7039 | <div class="section-method">
|
7040 |
|
7041 |
|
7042 |
|
7043 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Getters"><span class="type-signature">(static) </span>.🏷⠀Getters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
7044 |
|
7045 |
|
7046 |
|
7047 |
|
7048 |
|
7049 | <div class="description">
|
7050 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
7051 | </div>
|
7052 |
|
7053 |
|
7054 |
|
7055 |
|
7056 |
|
7057 | <dl class="details">
|
7058 |
|
7059 |
|
7060 |
|
7061 |
|
7062 |
|
7063 |
|
7064 |
|
7065 |
|
7066 |
|
7067 |
|
7068 |
|
7069 |
|
7070 |
|
7071 |
|
7072 |
|
7073 |
|
7074 |
|
7075 |
|
7076 |
|
7077 |
|
7078 |
|
7079 |
|
7080 |
|
7081 |
|
7082 |
|
7083 |
|
7084 | <dt class="tag-source">Source:</dt>
|
7085 | <dd class="tag-source"><ul class="dummy"><li>
|
7086 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line337">line 337</a>
|
7087 | </li></ul></dd>
|
7088 |
|
7089 |
|
7090 |
|
7091 |
|
7092 |
|
7093 |
|
7094 |
|
7095 | </dl>
|
7096 |
|
7097 |
|
7098 |
|
7099 |
|
7100 |
|
7101 |
|
7102 |
|
7103 |
|
7104 |
|
7105 | <h5>Parameters:</h5>
|
7106 |
|
7107 |
|
7108 | <table class="params">
|
7109 | <thead>
|
7110 | <tr>
|
7111 |
|
7112 | <th>Name</th>
|
7113 |
|
7114 |
|
7115 | <th>Type</th>
|
7116 |
|
7117 |
|
7118 |
|
7119 |
|
7120 |
|
7121 | <th class="last">Description</th>
|
7122 | </tr>
|
7123 | </thead>
|
7124 |
|
7125 | <tbody>
|
7126 |
|
7127 |
|
7128 | <tr>
|
7129 |
|
7130 | <td class="name"><code>propertyNames</code></td>
|
7131 |
|
7132 |
|
7133 | <td class="type">
|
7134 |
|
7135 |
|
7136 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
7137 |
|
7138 |
|
7139 |
|
7140 | </td>
|
7141 |
|
7142 |
|
7143 |
|
7144 |
|
7145 |
|
7146 | <td class="description last">
|
7147 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters that surface those properties as GraphQL fields.</p>
|
7148 |
|
7149 | </td>
|
7150 | </tr>
|
7151 |
|
7152 |
|
7153 | </tbody>
|
7154 | </table>
|
7155 |
|
7156 |
|
7157 |
|
7158 |
|
7159 |
|
7160 |
|
7161 |
|
7162 |
|
7163 |
|
7164 |
|
7165 |
|
7166 |
|
7167 |
|
7168 |
|
7169 | <div class="section-returns">
|
7170 | <h5>Returns:</h5>
|
7171 |
|
7172 |
|
7173 |
|
7174 | <dl class="param-type">
|
7175 | <dt>
|
7176 | Type:
|
7177 | </dt>
|
7178 | <dd>
|
7179 |
|
7180 | <span class="param-type"><code>function</code></span>
|
7181 |
|
7182 |
|
7183 | </dd>
|
7184 | </dl>
|
7185 |
|
7186 |
|
7187 | <div class="param-desc">
|
7188 | <p>a class decorator method.s</p>
|
7189 | </div>
|
7190 |
|
7191 |
|
7192 | </div>
|
7193 |
|
7194 |
|
7195 |
|
7196 | </div>
|
7197 |
|
7198 |
|
7199 | <div class="section-method">
|
7200 |
|
7201 |
|
7202 |
|
7203 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Properties"><span class="type-signature">(static) </span>.🏷⠀Properties<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
7204 |
|
7205 |
|
7206 |
|
7207 |
|
7208 |
|
7209 | <div class="description">
|
7210 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the getters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which getters should be injected.</p>
|
7211 | <p>This method creates both getters and setters</p>
|
7212 | </div>
|
7213 |
|
7214 |
|
7215 |
|
7216 |
|
7217 |
|
7218 | <dl class="details">
|
7219 |
|
7220 |
|
7221 |
|
7222 |
|
7223 | <dt class="tag-since">Since:</dt>
|
7224 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
7225 |
|
7226 |
|
7227 |
|
7228 |
|
7229 |
|
7230 |
|
7231 |
|
7232 |
|
7233 |
|
7234 |
|
7235 |
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 |
|
7242 |
|
7243 |
|
7244 |
|
7245 |
|
7246 |
|
7247 |
|
7248 | <dt class="tag-source">Source:</dt>
|
7249 | <dd class="tag-source"><ul class="dummy"><li>
|
7250 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line426">line 426</a>
|
7251 | </li></ul></dd>
|
7252 |
|
7253 |
|
7254 |
|
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 | </dl>
|
7260 |
|
7261 |
|
7262 |
|
7263 |
|
7264 |
|
7265 |
|
7266 |
|
7267 |
|
7268 |
|
7269 | <h5>Parameters:</h5>
|
7270 |
|
7271 |
|
7272 | <table class="params">
|
7273 | <thead>
|
7274 | <tr>
|
7275 |
|
7276 | <th>Name</th>
|
7277 |
|
7278 |
|
7279 | <th>Type</th>
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 | <th class="last">Description</th>
|
7286 | </tr>
|
7287 | </thead>
|
7288 |
|
7289 | <tbody>
|
7290 |
|
7291 |
|
7292 | <tr>
|
7293 |
|
7294 | <td class="name"><code>propertyNames</code></td>
|
7295 |
|
7296 |
|
7297 | <td class="type">
|
7298 |
|
7299 |
|
7300 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
7301 |
|
7302 |
|
7303 |
|
7304 | </td>
|
7305 |
|
7306 |
|
7307 |
|
7308 |
|
7309 |
|
7310 | <td class="description last">
|
7311 | <p>if the model has 'name'<br>and 'age' as properties, then passing those two strings will result<br>in getters and setters that surface those properties as GraphQL fields.</p>
|
7312 |
|
7313 | </td>
|
7314 | </tr>
|
7315 |
|
7316 |
|
7317 | </tbody>
|
7318 | </table>
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 |
|
7333 | <div class="section-returns">
|
7334 | <h5>Returns:</h5>
|
7335 |
|
7336 |
|
7337 |
|
7338 | <dl class="param-type">
|
7339 | <dt>
|
7340 | Type:
|
7341 | </dt>
|
7342 | <dd>
|
7343 |
|
7344 | <span class="param-type"><code>function</code></span>
|
7345 |
|
7346 |
|
7347 | </dd>
|
7348 | </dl>
|
7349 |
|
7350 |
|
7351 | <div class="param-desc">
|
7352 | <p>a class decorator method</p>
|
7353 | </div>
|
7354 |
|
7355 |
|
7356 | </div>
|
7357 |
|
7358 |
|
7359 |
|
7360 | </div>
|
7361 |
|
7362 |
|
7363 | <div class="section-method">
|
7364 |
|
7365 |
|
7366 |
|
7367 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Schema"><span class="type-signature">(static) </span>.🏷⠀Schema<span class="signature">(schemaString)</span><span class="type-signature"></span></h4>
|
7368 |
|
7369 |
|
7370 |
|
7371 |
|
7372 |
|
7373 | <div class="description">
|
7374 | <p>This decorator allows you to specify the SCHEMA getter and associated<br>string as a parameter to the decorator itself. So, for example:</p>
|
7375 | <p><code></p>
|
7376 | </div>
|
7377 |
|
7378 |
|
7379 |
|
7380 |
|
7381 |
|
7382 | <dl class="details">
|
7383 |
|
7384 |
|
7385 |
|
7386 |
|
7387 | <dt class="tag-since">Since:</dt>
|
7388 | <dd class="tag-since"><ul class="dummy"><li>2.2.0</li></ul></dd>
|
7389 |
|
7390 |
|
7391 |
|
7392 |
|
7393 |
|
7394 |
|
7395 |
|
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 |
|
7403 |
|
7404 |
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 |
|
7411 |
|
7412 | <dt class="tag-source">Source:</dt>
|
7413 | <dd class="tag-source"><ul class="dummy"><li>
|
7414 | <a href="decorators_Schema.js.html">decorators/Schema.js</a>, <a href="decorators_Schema.js.html#line4">line 4</a>
|
7415 | </li></ul></dd>
|
7416 |
|
7417 |
|
7418 |
|
7419 |
|
7420 |
|
7421 |
|
7422 |
|
7423 | </dl>
|
7424 |
|
7425 |
|
7426 |
|
7427 |
|
7428 |
|
7429 |
|
7430 |
|
7431 |
|
7432 |
|
7433 | <h5>Parameters:</h5>
|
7434 |
|
7435 |
|
7436 | <table class="params">
|
7437 | <thead>
|
7438 | <tr>
|
7439 |
|
7440 | <th>Name</th>
|
7441 |
|
7442 |
|
7443 | <th>Type</th>
|
7444 |
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 | <th class="last">Description</th>
|
7450 | </tr>
|
7451 | </thead>
|
7452 |
|
7453 | <tbody>
|
7454 |
|
7455 |
|
7456 | <tr>
|
7457 |
|
7458 | <td class="name"><code>schemaString</code></td>
|
7459 |
|
7460 |
|
7461 | <td class="type">
|
7462 |
|
7463 |
|
7464 | <span class="param-type"><code>string</code></span>
|
7465 |
|
7466 |
|
7467 |
|
7468 | </td>
|
7469 |
|
7470 |
|
7471 |
|
7472 |
|
7473 |
|
7474 | <td class="description last">
|
7475 | <p>a GraphQL IDL compliant string for defining a<br>GraphQL Object Schema.</p>
|
7476 |
|
7477 | </td>
|
7478 | </tr>
|
7479 |
|
7480 |
|
7481 | </tbody>
|
7482 | </table>
|
7483 |
|
7484 |
|
7485 |
|
7486 |
|
7487 |
|
7488 |
|
7489 |
|
7490 |
|
7491 |
|
7492 |
|
7493 |
|
7494 |
|
7495 |
|
7496 |
|
7497 |
|
7498 |
|
7499 | </div>
|
7500 |
|
7501 |
|
7502 | <div class="section-method">
|
7503 |
|
7504 |
|
7505 |
|
7506 | <h4 class="name" id="..%F0%9F%8F%B7%E2%A0%80Setters"><span class="type-signature">(static) </span>.🏷⠀Setters<span class="signature">(propertyNames)</span><span class="type-signature"> → {function}</span></h4>
|
7507 |
|
7508 |
|
7509 |
|
7510 |
|
7511 |
|
7512 | <div class="description">
|
7513 | <p>When working with <code>GQLBase</code> instances that expose properties<br>that have a 1:1 mapping to their own model property of the<br>same name, adding the setters manually can be annoying. This<br>takes an indeterminate amount of strings representing the<br>properties for which setters should be injected.</p>
|
7514 | </div>
|
7515 |
|
7516 |
|
7517 |
|
7518 |
|
7519 |
|
7520 | <dl class="details">
|
7521 |
|
7522 |
|
7523 |
|
7524 |
|
7525 | <dt class="tag-since">Since:</dt>
|
7526 | <dd class="tag-since"><ul class="dummy"><li>2.1.0</li></ul></dd>
|
7527 |
|
7528 |
|
7529 |
|
7530 |
|
7531 |
|
7532 |
|
7533 |
|
7534 |
|
7535 |
|
7536 |
|
7537 |
|
7538 |
|
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 |
|
7549 |
|
7550 | <dt class="tag-source">Source:</dt>
|
7551 | <dd class="tag-source"><ul class="dummy"><li>
|
7552 | <a href="decorators_ModelProperties.js.html">decorators/ModelProperties.js</a>, <a href="decorators_ModelProperties.js.html#line381">line 381</a>
|
7553 | </li></ul></dd>
|
7554 |
|
7555 |
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 | </dl>
|
7562 |
|
7563 |
|
7564 |
|
7565 |
|
7566 |
|
7567 |
|
7568 |
|
7569 |
|
7570 |
|
7571 | <h5>Parameters:</h5>
|
7572 |
|
7573 |
|
7574 | <table class="params">
|
7575 | <thead>
|
7576 | <tr>
|
7577 |
|
7578 | <th>Name</th>
|
7579 |
|
7580 |
|
7581 | <th>Type</th>
|
7582 |
|
7583 |
|
7584 |
|
7585 |
|
7586 |
|
7587 | <th class="last">Description</th>
|
7588 | </tr>
|
7589 | </thead>
|
7590 |
|
7591 | <tbody>
|
7592 |
|
7593 |
|
7594 | <tr>
|
7595 |
|
7596 | <td class="name"><code>propertyNames</code></td>
|
7597 |
|
7598 |
|
7599 | <td class="type">
|
7600 |
|
7601 |
|
7602 | <span class="param-type"><code>Array.<(String|Array.<String>)></code></span>
|
7603 |
|
7604 |
|
7605 |
|
7606 | </td>
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 | <td class="description last">
|
7613 | <p>if the model has<br>'name' and 'age' as properties, then passing those two strings will<br>result in setters that surface those properties as GraphQL fields.</p>
|
7614 |
|
7615 | </td>
|
7616 | </tr>
|
7617 |
|
7618 |
|
7619 | </tbody>
|
7620 | </table>
|
7621 |
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 |
|
7627 |
|
7628 |
|
7629 |
|
7630 |
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 | <div class="section-returns">
|
7636 | <h5>Returns:</h5>
|
7637 |
|
7638 |
|
7639 |
|
7640 | <dl class="param-type">
|
7641 | <dt>
|
7642 | Type:
|
7643 | </dt>
|
7644 | <dd>
|
7645 |
|
7646 | <span class="param-type"><code>function</code></span>
|
7647 |
|
7648 |
|
7649 | </dd>
|
7650 | </dl>
|
7651 |
|
7652 |
|
7653 | <div class="param-desc">
|
7654 | <p>a class decorator method</p>
|
7655 | </div>
|
7656 |
|
7657 |
|
7658 | </div>
|
7659 |
|
7660 |
|
7661 |
|
7662 | </div>
|
7663 |
|
7664 |
|
7665 | <div class="section-method">
|
7666 |
|
7667 |
|
7668 |
|
7669 | <h4 class="name" id="~decorate"><span class="type-signature">(inner) </span>decorate<span class="signature">(metaProperty, target, key, descriptor)</span><span class="type-signature"></span></h4>
|
7670 |
|
7671 |
|
7672 |
|
7673 |
|
7674 |
|
7675 | <div class="description">
|
7676 | <p>Since the bulk functionality of @subscriptor, @mutator and</p>
|
7677 | </div>
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 |
|
7683 | <dl class="details">
|
7684 |
|
7685 |
|
7686 |
|
7687 |
|
7688 |
|
7689 |
|
7690 |
|
7691 |
|
7692 |
|
7693 |
|
7694 |
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 |
|
7705 |
|
7706 |
|
7707 |
|
7708 |
|
7709 |
|
7710 | <dt class="tag-source">Source:</dt>
|
7711 | <dd class="tag-source"><ul class="dummy"><li>
|
7712 | <a href="decorators_Resolvers.js.html">decorators/Resolvers.js</a>, <a href="decorators_Resolvers.js.html#line7">line 7</a>
|
7713 | </li></ul></dd>
|
7714 |
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 |
|
7721 | </dl>
|
7722 |
|
7723 |
|
7724 |
|
7725 |
|
7726 |
|
7727 |
|
7728 |
|
7729 |
|
7730 |
|
7731 | <h5>Parameters:</h5>
|
7732 |
|
7733 |
|
7734 | <table class="params">
|
7735 | <thead>
|
7736 | <tr>
|
7737 |
|
7738 | <th>Name</th>
|
7739 |
|
7740 |
|
7741 | <th>Type</th>
|
7742 |
|
7743 |
|
7744 |
|
7745 |
|
7746 |
|
7747 | <th class="last">Description</th>
|
7748 | </tr>
|
7749 | </thead>
|
7750 |
|
7751 | <tbody>
|
7752 |
|
7753 |
|
7754 | <tr>
|
7755 |
|
7756 | <td class="name"><code>metaProperty</code></td>
|
7757 |
|
7758 |
|
7759 | <td class="type">
|
7760 |
|
7761 |
|
7762 | <span class="param-type"><code>string</code></span>
|
7763 |
|
7764 |
|
7765 |
|
7766 | </td>
|
7767 |
|
7768 |
|
7769 |
|
7770 |
|
7771 |
|
7772 | <td class="description last">
|
7773 | <p>the name of the meta sub key under which to<br>store the modified decorated function.</p>
|
7774 |
|
7775 | </td>
|
7776 | </tr>
|
7777 |
|
7778 |
|
7779 |
|
7780 | <tr>
|
7781 |
|
7782 | <td class="name"><code>target</code></td>
|
7783 |
|
7784 |
|
7785 | <td class="type">
|
7786 |
|
7787 |
|
7788 | <span class="param-type"><code>Object</code></span>
|
7789 | |
|
7790 |
|
7791 | <span class="param-type"><code>function</code></span>
|
7792 |
|
7793 |
|
7794 |
|
7795 | </td>
|
7796 |
|
7797 |
|
7798 |
|
7799 |
|
7800 |
|
7801 | <td class="description last">
|
7802 | <p>either the Class itself, if defined<br>on a static method, or the prototype if defined on an instance method</p>
|
7803 |
|
7804 | </td>
|
7805 | </tr>
|
7806 |
|
7807 |
|
7808 |
|
7809 | <tr>
|
7810 |
|
7811 | <td class="name"><code>key</code></td>
|
7812 |
|
7813 |
|
7814 | <td class="type">
|
7815 |
|
7816 |
|
7817 | <span class="param-type"><code>string</code></span>
|
7818 |
|
7819 |
|
7820 |
|
7821 | </td>
|
7822 |
|
7823 |
|
7824 |
|
7825 |
|
7826 |
|
7827 | <td class="description last">
|
7828 | <p>the property name of the function being decorated</p>
|
7829 |
|
7830 | </td>
|
7831 | </tr>
|
7832 |
|
7833 |
|
7834 |
|
7835 | <tr>
|
7836 |
|
7837 | <td class="name"><code>descriptor</code></td>
|
7838 |
|
7839 |
|
7840 | <td class="type">
|
7841 |
|
7842 |
|
7843 | <span class="param-type"><code>Object</code></span>
|
7844 |
|
7845 |
|
7846 |
|
7847 | </td>
|
7848 |
|
7849 |
|
7850 |
|
7851 |
|
7852 |
|
7853 | <td class="description last">
|
7854 | <p>a decorator descriptor; see<br><code>Object.defineProperty</code> for more information on descriptors</p>
|
7855 |
|
7856 | </td>
|
7857 | </tr>
|
7858 |
|
7859 |
|
7860 | </tbody>
|
7861 | </table>
|
7862 |
|
7863 |
|
7864 |
|
7865 |
|
7866 |
|
7867 |
|
7868 |
|
7869 |
|
7870 |
|
7871 |
|
7872 |
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 |
|
7878 | </div>
|
7879 |
|
7880 |
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 | </article>
|
7886 |
|
7887 | </section>
|
7888 |
|
7889 |
|
7890 |
|
7891 |
|
7892 | </div>
|
7893 |
|
7894 | <br class="clear">
|
7895 |
|
7896 | <footer>
|
7897 | Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Jun 08 2018 19:28:39 GMT-0700 (PDT) using the Minami theme.
|
7898 | </footer>
|
7899 |
|
7900 | <script>prettyPrint();</script>
|
7901 | <script src="scripts/linenumber.js"></script>
|
7902 | </body>
|
7903 | </html> |
\ | No newline at end of file |