typeDefs for respect added

This commit is contained in:
Belen Curcio
2017-03-29 17:40:29 -03:00
parent 635df54a2c
commit 4ca2a48bc9
3 changed files with 55 additions and 1 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
{
"server": [],
"server": [
"coral-plugin-respect"
],
"client": [
"coral-plugin-respect"
]
+5
View File
@@ -0,0 +1,5 @@
const typeDefs = require('./server/typeDefs');
module.exports = {
typeDefs
};
@@ -0,0 +1,47 @@
module.exports = `
enum ACTION_TYPE {
# Represents a Respect.
RESPECT
}
input CreateRespectInput {
# The item's id for which we are to create a respect.
item_id: ID!
# The type of the item for which we are to create the respect.
item_type: ACTION_ITEM_TYPE!
}
# RespectAction is used by users who "respect" a specific entity.
type RespectAction implements Action {
# The ID of the action.
id: ID!
# The author of the action.
user: User
# The time when the Action was updated.
updated_at: Date
# The time when the Action was created.
created_at: Date
}
type CreateRespectResponse implements Response {
# The respect that was created.
respect: RespectAction
# An array of errors relating to the mutation that occurred.
errors: [UserError]
}
type RootMutation {
# Creates a respect on an entity.
createRespect(respect: CreateRespectInput!): CreateRespectResponse
}
`;