mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
The name for the tag is called ID.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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())
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user