From 919bdff40adbeba10a62de9beafbdd3565e49043 Mon Sep 17 00:00:00 2001 From: David Erwin Date: Thu, 13 Jul 2017 09:26:09 -0400 Subject: [PATCH 1/7] Use less words, say same thing --- docs/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index 180e172ac..d914bcf03 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -17,7 +17,7 @@ Talk consists of four distinct layers of code: ### Plugins -Talk plugins deliver the features and functionality that can be changed or removed. Much of the default functionality is delivered by plugins allowing developers to change behavior along product lines that we've found to be important. +Talk plugins deliver the features and functionality that can be changed or removed. Much of the default functionality is delivered by core plugins allowing developers to have control over any non-essential functionality. ### Plugin API From 3d666111b0a35745159dcf11d8bed016308c1b49 Mon Sep 17 00:00:00 2001 From: David Erwin Date: Thu, 13 Jul 2017 09:26:37 -0400 Subject: [PATCH 2/7] Add metadata docs --- docs/_data/sidebars/talk_sidebar.yml | 30 +++++++++++++++------------- docs/architecture-metadata.md | 0 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 docs/architecture-metadata.md diff --git a/docs/_data/sidebars/talk_sidebar.yml b/docs/_data/sidebars/talk_sidebar.yml index 62660783c..ebbc6e006 100644 --- a/docs/_data/sidebars/talk_sidebar.yml +++ b/docs/_data/sidebars/talk_sidebar.yml @@ -37,20 +37,6 @@ entries: url: /install-setup.html output: web - - title: Architecture - output: web - folderitems: - - title: Overview - url: /architecture.html - output: web - - title: Tags - url: /architecture-tags.html - output: web - - title: cli - url: /architecture-cli.html - output: web - - - title: Plugins output: web folderitems: @@ -70,6 +56,22 @@ entries: url: /plugins-experimental.html output: web + - title: Architecture + output: web + folderitems: + - title: Overview + url: /architecture.html + output: web + - title: Tags + url: /architecture-tags.html + output: web + - title: Metadata API + url: /architecture-metadata.html + output: web + - title: cli + url: /architecture-cli.html + output: web + - title: Development output: web folderitems: diff --git a/docs/architecture-metadata.md b/docs/architecture-metadata.md new file mode 100644 index 000000000..e69de29bb From 1280b16bcdb1378579a0e0155856426664815442 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 13 Jul 2017 20:47:30 +0700 Subject: [PATCH 3/7] Remove some global css, fix some styling issues --- client/coral-embed-stream/src/components/Stream.css | 3 +++ client/coral-embed-stream/style/default.css | 12 ------------ client/coral-plugin-best/BestButton.css | 4 ++++ client/coral-plugin-best/BestButton.js | 2 +- client/coral-ui/components/Icon.css | 7 +++++++ client/coral-ui/components/Icon.js | 4 +++- 6 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 client/coral-ui/components/Icon.css diff --git a/client/coral-embed-stream/src/components/Stream.css b/client/coral-embed-stream/src/components/Stream.css index 06f1efd1f..8c5a4250b 100644 --- a/client/coral-embed-stream/src/components/Stream.css +++ b/client/coral-embed-stream/src/components/Stream.css @@ -22,5 +22,8 @@ } .tabContainer { + position: relative; margin-top: 28px; + padding-bottom: 50px; + min-height: 600px; } diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 887b780ce..437397a98 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -21,18 +21,6 @@ body { padding: 4px; } -.talk-stream-tab-container { - padding-bottom: 50px; - min-height: 600px; -} - -.talk-stream-tab-container .material-icons { - vertical-align: middle; - width: 1em; - font-size: 1em; - overflow: hidden; -} - .expandForSignin { min-height: 600px; } diff --git a/client/coral-plugin-best/BestButton.css b/client/coral-plugin-best/BestButton.css index b1f169ff6..d1660ad5a 100644 --- a/client/coral-plugin-best/BestButton.css +++ b/client/coral-plugin-best/BestButton.css @@ -2,3 +2,7 @@ composes: buttonReset from "coral-framework/styles/reset.css"; margin: 5px 10px 5px 0px; } + +.tagIcon { + font-size: 12px; +} diff --git a/client/coral-plugin-best/BestButton.js b/client/coral-plugin-best/BestButton.js index ac6d03fd8..c5ebeb907 100644 --- a/client/coral-plugin-best/BestButton.js +++ b/client/coral-plugin-best/BestButton.js @@ -18,7 +18,7 @@ const canModifyBestTag = ({roles = []} = {}) => roles && ['ADMIN', 'MODERATOR']. // Put this on a comment to show that it is best -export const BestIndicator = ({children = }) => ( +export const BestIndicator = ({children = }) => ( { children } diff --git a/client/coral-ui/components/Icon.css b/client/coral-ui/components/Icon.css new file mode 100644 index 000000000..ec9a9dabc --- /dev/null +++ b/client/coral-ui/components/Icon.css @@ -0,0 +1,7 @@ + +.root { + vertical-align: middle; + width: 1em; + font-size: 1em; + overflow: hidden; +} diff --git a/client/coral-ui/components/Icon.js b/client/coral-ui/components/Icon.js index b7c49a799..025b6df9e 100644 --- a/client/coral-ui/components/Icon.js +++ b/client/coral-ui/components/Icon.js @@ -1,8 +1,10 @@ import React, {PropTypes} from 'react'; import {Icon as IconMDL} from 'react-mdl'; +import cn from 'classnames'; +import styles from './Icon.css'; const Icon = ({className = '', name}) => ( - + ); Icon.propTypes = { From 47fd522f68553aac209f2c4b87581a1a27ae47d2 Mon Sep 17 00:00:00 2001 From: David Erwin Date: Thu, 13 Jul 2017 10:25:36 -0400 Subject: [PATCH 4/7] Add first draft --- docs/architecture-metadata.md | 94 +++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/docs/architecture-metadata.md b/docs/architecture-metadata.md index e69de29bb..73530edf3 100644 --- a/docs/architecture-metadata.md +++ b/docs/architecture-metadata.md @@ -0,0 +1,94 @@ +--- +title: Metadata API +keywords: architecture +sidebar: talk_sidebar +permalink: architecture-metadata.html +summary: +--- + +The _metadata api_ allows you to add fields to models that are not represented in the core schema. Most core models ship with metadata enabled. If you would like to add metadata to a model that does not support it, [please let us know](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md#writing-code). + +## Goals + +The metadata api is designed to satisfy two product goals: + +* Give developers flexibility in extending datatypes. +* Protect core fields that are essential to Talk's operation. + +## Design + +Metadata is represented by an [subdocument in our Schemas](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/models/comment.js#L74). This takes advantage of Mongo's flexibility allowing for any data to be stored therein. + +### Setting Metadata + +Talk provides [a service layer](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js) allowing developer to `set` and `unset` metadata on objects in a way similar to key-value stores. + +Let's say that I want to add a custom field called `potency` to a comment. + +``` +const MetadataService = require('services/metadata'); +const CommentModel = require('models/comment'); + +// Sets the property `loaded` on the comment with `id=1`. +MetadataService.set(CommentModel, '1', 'potency', 42); +``` + +Note that the model passed here is the Model itself and not a loaded comment. This allows us to update the value on that document [in an atomic manner](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js#L60) for efficiency and to prevent race conditions. + +### Accessing Metadata + +The metadata api does not contain a `get` method. This is so because the metadata object is retrieved through database queries. It is up to the code that accesses the objects from the database to handle relevant metadata fields. + +The metadata object can be queried as any other subdocument without restriction. + +#### Accessing via the Graph + +One of the first principles of GraphQL is that the shape of the graph does not need to be the same as the shape of the data in the database. In fact, it probably shouldn't be. + +This enables us to treat metadata fields in any way that makes sense as we design our Graph. The fact that a value is stored in the metadata object is an implementation detail invisible to the front end. + +Take for example, the `reason` field in the `FlagAction` type. This stores the user provided reason that they flagged a comment. As far as the front end knows, it's [just another field](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/graph/typeDefs.graphql#L453) alongside the core fields: + +``` +# graph/typeDefs.graphql +type FlagAction implements Action { + + ... + + # The reason for which the Flag Action was created. + reason: String + + ... +} +``` + +If, however, we [look at the resolver](https://github.com/coralproject/talk/blob/a47e2378e96f34f25447782f3e7ce59fa48ec791/graph/resolvers/dont_agree_action.js) for that field, we see that `message` is destructured from the metadata object and returned. + +``` +// graph/resolvers/dont_agree_action.js +const DontAgreeAction = { + + // Stored in the metadata, extract and return. + reason({metadata: {reason}}) { + return reason; + } +}; + +module.exports = DontAgreeAction; +``` + +This is an extremely powerful pattern as it allows us absolute freedom in designing our graph and complete isolation of the added values in the database. + +## Some things to keep in mind + +### Namespace your metadata fields + +Since metadata can be added by the core and multiple plugins, collisions may occur. As you create your plugins, please be careful to pick unique names for metadata fields. We recommend namespacing all your fields in a subdocument named after your plugin. + +``` +[model].metadata.[your_plugin_name].[the_field] +``` + +### Querying by metadata fields + +We currently do not have a clean way to index metadata fields. As a result queries that match against metadata fields will not scale. If you have a need to match, sort, etc... by a metadata field, [please let us know](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md#writing-code). From 83832abd726f52891f025c86abb8a7ab3961f8ae Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 13 Jul 2017 21:37:08 +0700 Subject: [PATCH 5/7] More fixes --- client/coral-embed-stream/src/components/Comment.css | 5 +++++ .../src/components/EditableCommentContent.js | 2 +- client/coral-embed-stream/style/default.css | 5 ----- client/coral-plugin-best/BestButton.css | 6 ++++++ client/coral-plugin-best/BestButton.js | 2 +- client/coral-plugin-flags/components/FlagButton.js | 2 +- client/coral-plugin-flags/components/styles.css | 6 ++++++ client/coral-plugin-history/Comment.css | 5 +++++ client/coral-plugin-history/Comment.js | 4 ++-- client/coral-plugin-replies/ReplyButton.css | 6 ++++++ client/coral-plugin-replies/ReplyButton.js | 2 +- client/coral-ui/components/Icon.css | 4 ---- plugins/coral-plugin-like/client/styles.css | 4 +++- plugins/coral-plugin-love/client/styles.css | 4 +++- plugins/coral-plugin-respect/client/styles.css | 3 ++- .../client/components/ViewingOptions.css | 5 +++++ .../client/components/ViewingOptions.js | 2 +- .../client/components/PermalinkButton.js | 2 +- plugins/talk-plugin-permalink/client/components/styles.css | 6 ++++++ 19 files changed, 55 insertions(+), 20 deletions(-) diff --git a/client/coral-embed-stream/src/components/Comment.css b/client/coral-embed-stream/src/components/Comment.css index d397185dc..143577cf6 100644 --- a/client/coral-embed-stream/src/components/Comment.css +++ b/client/coral-embed-stream/src/components/Comment.css @@ -157,3 +157,8 @@ .enter { animation: enter 1000ms; } + +.timerIcon { + vertical-align: middle; + font-size: 14px; +} diff --git a/client/coral-embed-stream/src/components/EditableCommentContent.js b/client/coral-embed-stream/src/components/EditableCommentContent.js index 06d8e6b9d..98be14d13 100644 --- a/client/coral-embed-stream/src/components/EditableCommentContent.js +++ b/client/coral-embed-stream/src/components/EditableCommentContent.js @@ -145,7 +145,7 @@ export class EditableCommentContent extends React.Component { } : - {t('edit_comment.edit_window_timer_prefix')} + {t('edit_comment.edit_window_timer_prefix')} (remainingMs <= 10 * 1000) ? styles.editWindowAlmostOver : '' } diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 437397a98..90a6250a3 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -271,11 +271,6 @@ body { float: left; } -.comment__action-container .material-icons { - font-size: 12px; - margin-left: 3px; -} - button.comment__action-button, .comment__action-button button { cursor: pointer; diff --git a/client/coral-plugin-best/BestButton.css b/client/coral-plugin-best/BestButton.css index d1660ad5a..ca77f01f2 100644 --- a/client/coral-plugin-best/BestButton.css +++ b/client/coral-plugin-best/BestButton.css @@ -5,4 +5,10 @@ .tagIcon { font-size: 12px; + vertical-align: middle; +} + +.icon { + font-size: 12px; + vertical-align: middle; } diff --git a/client/coral-plugin-best/BestButton.js b/client/coral-plugin-best/BestButton.js index c5ebeb907..34bdad201 100644 --- a/client/coral-plugin-best/BestButton.js +++ b/client/coral-plugin-best/BestButton.js @@ -98,7 +98,7 @@ export class BestButton extends Component { disabled={disabled} className={cn(styles.button, `${name}-button`, `e2e__${isBest ? 'unset' : 'set'}-best-comment`)} aria-label={t(isBest ? 'unset_best' : 'set_best')}> - + ); } diff --git a/client/coral-plugin-flags/components/FlagButton.js b/client/coral-plugin-flags/components/FlagButton.js index 33499e83d..51b88391e 100644 --- a/client/coral-plugin-flags/components/FlagButton.js +++ b/client/coral-plugin-flags/components/FlagButton.js @@ -155,7 +155,7 @@ export default class FlagButton extends Component { : {t('report')} } {
  • - {t('view_conversation')} + {t('view_conversation')}
  • - + { {t('reply')} - reply ); diff --git a/client/coral-ui/components/Icon.css b/client/coral-ui/components/Icon.css index ec9a9dabc..16fe6d235 100644 --- a/client/coral-ui/components/Icon.css +++ b/client/coral-ui/components/Icon.css @@ -1,7 +1,3 @@ .root { - vertical-align: middle; - width: 1em; - font-size: 1em; - overflow: hidden; } diff --git a/plugins/coral-plugin-like/client/styles.css b/plugins/coral-plugin-like/client/styles.css index 9ce0d5271..859581bd4 100644 --- a/plugins/coral-plugin-like/client/styles.css +++ b/plugins/coral-plugin-like/client/styles.css @@ -25,7 +25,9 @@ } .icon { - padding: 0 2px; + font-size: 12px; + padding: 0 2px 0 5px; + vertical-align: middle; } @media (max-width: 425px) { diff --git a/plugins/coral-plugin-love/client/styles.css b/plugins/coral-plugin-love/client/styles.css index d7753a0e9..9d1bec487 100644 --- a/plugins/coral-plugin-love/client/styles.css +++ b/plugins/coral-plugin-love/client/styles.css @@ -25,7 +25,9 @@ } .icon { - padding: 0 2px; + font-size: 12px; + padding: 0 2px 0 5px; + vertical-align: middle; } @media (max-width: 425px) { diff --git a/plugins/coral-plugin-respect/client/styles.css b/plugins/coral-plugin-respect/client/styles.css index 3ab0fbd29..362e02b8f 100644 --- a/plugins/coral-plugin-respect/client/styles.css +++ b/plugins/coral-plugin-respect/client/styles.css @@ -26,7 +26,8 @@ } .icon { - padding: 0 2px; + font-size: 12px; + padding: 0 3px; } @media (max-width: 425px) { diff --git a/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.css b/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.css index 9c302d07e..81d373b95 100644 --- a/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.css +++ b/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.css @@ -24,3 +24,8 @@ list-style: none; white-space: nowrap; } + +.icon { + font-size: 14px; + vertical-align: middle; +} diff --git a/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.js b/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.js index b64123fdb..87680b370 100644 --- a/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.js +++ b/plugins/coral-plugin-viewing-options/client/components/ViewingOptions.js @@ -24,7 +24,7 @@ const ViewingOptions = (props) => {
    { diff --git a/plugins/talk-plugin-permalink/client/components/PermalinkButton.js b/plugins/talk-plugin-permalink/client/components/PermalinkButton.js index 55b98e5d8..cca8718b5 100644 --- a/plugins/talk-plugin-permalink/client/components/PermalinkButton.js +++ b/plugins/talk-plugin-permalink/client/components/PermalinkButton.js @@ -72,7 +72,7 @@ export default class PermalinkButton extends React.Component { onClick={this.toggle} className={cn(`${name}-button`, styles.button)}> {t('permalink')} - +
    Date: Thu, 13 Jul 2017 10:49:38 -0400 Subject: [PATCH 6/7] Fewer, better words --- docs/_data/sidebars/talk_sidebar.yml | 32 ++++++++++++++-------------- docs/architecture-metadata.md | 16 ++++++-------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/_data/sidebars/talk_sidebar.yml b/docs/_data/sidebars/talk_sidebar.yml index ebbc6e006..282defcb5 100644 --- a/docs/_data/sidebars/talk_sidebar.yml +++ b/docs/_data/sidebars/talk_sidebar.yml @@ -37,6 +37,22 @@ entries: url: /install-setup.html output: web + - title: Architecture + output: web + folderitems: + - title: Overview + url: /architecture.html + output: web + - title: Tags + url: /architecture-tags.html + output: web + - title: Metadata API + url: /architecture-metadata.html + output: web + - title: cli + url: /architecture-cli.html + output: web + - title: Plugins output: web folderitems: @@ -56,22 +72,6 @@ entries: url: /plugins-experimental.html output: web - - title: Architecture - output: web - folderitems: - - title: Overview - url: /architecture.html - output: web - - title: Tags - url: /architecture-tags.html - output: web - - title: Metadata API - url: /architecture-metadata.html - output: web - - title: cli - url: /architecture-cli.html - output: web - - title: Development output: web folderitems: diff --git a/docs/architecture-metadata.md b/docs/architecture-metadata.md index 73530edf3..043a907eb 100644 --- a/docs/architecture-metadata.md +++ b/docs/architecture-metadata.md @@ -1,12 +1,12 @@ --- -title: Metadata API +title: Metadata keywords: architecture sidebar: talk_sidebar permalink: architecture-metadata.html summary: --- -The _metadata api_ allows you to add fields to models that are not represented in the core schema. Most core models ship with metadata enabled. If you would like to add metadata to a model that does not support it, [please let us know](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md#writing-code). +_Metadata_ allows you to add fields to models that are not represented in the core schema. ## Goals @@ -29,19 +29,17 @@ Let's say that I want to add a custom field called `potency` to a comment. const MetadataService = require('services/metadata'); const CommentModel = require('models/comment'); -// Sets the property `loaded` on the comment with `id=1`. +// Sets the property `potency` on the comment with `id=1`. MetadataService.set(CommentModel, '1', 'potency', 42); ``` -Note that the model passed here is the Model itself and not a loaded comment. This allows us to update the value on that document [in an atomic manner](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js#L60) for efficiency and to prevent race conditions. +Note that the model passed here is the Model itself and not an individual comment object. This allows us to update the value on that document [in an atomic manner](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js#L60) for efficiency and to prevent race conditions. ### Accessing Metadata -The metadata api does not contain a `get` method. This is so because the metadata object is retrieved through database queries. It is up to the code that accesses the objects from the database to handle relevant metadata fields. +The metadata api does not contain a `get` method. The metadata object is retrieved via database queries along with the rest of the data. -The metadata object can be queried as any other subdocument without restriction. - -#### Accessing via the Graph +## Metadata and the Graph One of the first principles of GraphQL is that the shape of the graph does not need to be the same as the shape of the data in the database. In fact, it probably shouldn't be. @@ -62,7 +60,7 @@ type FlagAction implements Action { } ``` -If, however, we [look at the resolver](https://github.com/coralproject/talk/blob/a47e2378e96f34f25447782f3e7ce59fa48ec791/graph/resolvers/dont_agree_action.js) for that field, we see that `message` is destructured from the metadata object and returned. +If, however, we [look at the resolver](https://github.com/coralproject/talk/blob/a47e2378e96f34f25447782f3e7ce59fa48ec791/graph/resolvers/dont_agree_action.js) for that field, we see that `message` is [destructured](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) from the metadata object and returned. ``` // graph/resolvers/dont_agree_action.js From 30b200d7346434c2e755e678748a84b7a3bf08ab Mon Sep 17 00:00:00 2001 From: David Erwin Date: Thu, 13 Jul 2017 10:58:31 -0400 Subject: [PATCH 7/7] Fix typos --- docs/architecture-metadata.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/architecture-metadata.md b/docs/architecture-metadata.md index 043a907eb..089127343 100644 --- a/docs/architecture-metadata.md +++ b/docs/architecture-metadata.md @@ -21,7 +21,7 @@ Metadata is represented by an [subdocument in our Schemas](https://github.com/co ### Setting Metadata -Talk provides [a service layer](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js) allowing developer to `set` and `unset` metadata on objects in a way similar to key-value stores. +Talk provides [a service layer](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/services/metadata.js) allowing developers to `set` and `unset` metadata on objects in a way similar to key-value stores. Let's say that I want to add a custom field called `potency` to a comment. @@ -45,7 +45,7 @@ One of the first principles of GraphQL is that the shape of the graph does not n This enables us to treat metadata fields in any way that makes sense as we design our Graph. The fact that a value is stored in the metadata object is an implementation detail invisible to the front end. -Take for example, the `reason` field in the `FlagAction` type. This stores the user provided reason that they flagged a comment. As far as the front end knows, it's [just another field](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/graph/typeDefs.graphql#L453) alongside the core fields: +Take for example, the `reason` field in the `FlagAction` type. This stores the user provided reason why they flagged a comment. As far as the front end knows, it's [just another field](https://github.com/coralproject/talk/blob/c59c09e1f42c51eed3b0d57b7c2882fc7b5edc13/graph/typeDefs.graphql#L453) alongside the core fields: ``` # graph/typeDefs.graphql @@ -60,7 +60,7 @@ type FlagAction implements Action { } ``` -If, however, we [look at the resolver](https://github.com/coralproject/talk/blob/a47e2378e96f34f25447782f3e7ce59fa48ec791/graph/resolvers/dont_agree_action.js) for that field, we see that `message` is [destructured](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) from the metadata object and returned. +If, however, we [look at the resolver](https://github.com/coralproject/talk/blob/a47e2378e96f34f25447782f3e7ce59fa48ec791/graph/resolvers/dont_agree_action.js) for that field, we see that `reason` is [destructured](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) from the metadata object and returned. ``` // graph/resolvers/dont_agree_action.js @@ -75,7 +75,7 @@ const DontAgreeAction = { module.exports = DontAgreeAction; ``` -This is an extremely powerful pattern as it allows us absolute freedom in designing our graph and complete isolation of the added values in the database. +This is an extremely powerful pattern as it allows us absolute freedom in designing our graph and complete isolation of the added fields in the database. ## Some things to keep in mind