Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-29 20:47:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
62d708faae399053637b22d5e66aa66156ec6f45
62d708fa
1 parent
c8035308
create sendMessage(subscribe)
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
back/src/api/Chat/sendMessage/sendMessage.graphql
back/src/api/Chat/sendMessage/sendMessage.js
back/src/api/Chat/sendMessage/sendMessage.graphql
View file @
62d708f
type Subscription {
sendMessage
(message: String!): Message!
sendMessage
: Message
}
...
...
back/src/api/Chat/sendMessage/sendMessage.js
View file @
62d708f
import
{
prisma
}
from
"../../../utils"
;
import
{
isAuthenticated
,
prisma
}
from
"../../../utils"
;
import
{
NEW_MESSAGE_TOPIC
}
from
"../../../topics"
;
export
default
{
Subscription
:
{
sendMessage
:
async
(
_
,
args
)
=>
{
const
{
message
}
=
args
;
sendMessage
:
{
subscribe
:
async
(
_
,
__
,
{
request
,
pubsub
})
=>
{
pubsub
.
asyncIterator
(
NEW_MESSAGE_TOPIC
);
},
},
},
};
...
...
Please
register
or
login
to post a comment