The name for the tag is called ID.

This commit is contained in:
gaba
2017-05-08 16:55:11 -07:00
parent 96cd5197e3
commit 7c09902294
5 changed files with 6 additions and 20 deletions
@@ -28,7 +28,7 @@ export default withFragments({
created_at
status
tags {
name
id
}
user {
id
@@ -6,7 +6,7 @@ fragment commentView on Comment {
created_at
status
tags {
name
id
}
user {
id
@@ -3,7 +3,7 @@ mutation AddCommentTag ($id: ID!, $tag: String!) {
comment {
id
tags {
name
id
}
}
errors {
@@ -3,7 +3,7 @@ mutation RemoveCommentTag ($id: ID!, $tag: String!) {
comment {
id
tags {
name
id
}
}
errors {
+2 -16
View File
@@ -1,25 +1,11 @@
const SettingsService = require('../../services/settings');
const SettingModel = require('../../models/setting');
const util = require('./util');
/**
* Search for tags based on their item_type.
* @param {String} item_type the item type to search by
* @return {Promise} resolves to distinct items tags
*/
const getByItemType = (_, item_type) => {
return SettingModel.distinct('tags.models', {item_type});
};
/**
* Creates a set of loaders based on a GraphQL context.
* @param {Object} context the context of the GraphQL request
* @return {Object} object of loaders
*/
module.exports = (context) => ({
Settings: {
get: new util.SingletonResolver(() => SettingsService.retrieve()),
getTagsByItemType: (item_type) => getByItemType(context, item_type)
}
module.exports = () => ({
Settings: new util.SingletonResolver(() => SettingsService.retrieve())
});