test sse endpoint
This commit is contained in:
parent
2ed61fd763
commit
582b666da2
12034
pnpm-lock.yaml
Normal file
12034
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -87,6 +87,7 @@ export const InboxView = () => {
|
||||||
setPostMessageText('')
|
setPostMessageText('')
|
||||||
setMessageToReply(null)
|
setMessageToReply(null)
|
||||||
chatWindow.scrollTop = chatWindow.scrollHeight
|
chatWindow.scrollTop = chatWindow.scrollHeight
|
||||||
|
console.log('!!! messages:', messages())
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[post message error]:', error)
|
console.error('[post message error]:', error)
|
||||||
}
|
}
|
||||||
|
@ -104,7 +105,6 @@ export const InboxView = () => {
|
||||||
if (textareaParent) {
|
if (textareaParent) {
|
||||||
textareaParent.dataset.replicatedValue = postMessageText()
|
textareaParent.dataset.replicatedValue = postMessageText()
|
||||||
}
|
}
|
||||||
console.log('!!! messages:', messages())
|
|
||||||
if (params['initChat']) {
|
if (params['initChat']) {
|
||||||
try {
|
try {
|
||||||
const newChat = await actions.createChat([Number(params['initChat'])], '')
|
const newChat = await actions.createChat([Number(params['initChat'])], '')
|
||||||
|
|
|
@ -49,7 +49,8 @@ export const InboxProvider = (props: { children: JSX.Element }) => {
|
||||||
const { unsubscribe } = pipe(
|
const { unsubscribe } = pipe(
|
||||||
subclient().subscription(newMessage, {}),
|
subclient().subscription(newMessage, {}),
|
||||||
subscribe((result) => {
|
subscribe((result) => {
|
||||||
console.debug('[subscription] ' + result)
|
console.info('[subscription]')
|
||||||
|
console.debug(result)
|
||||||
// TODO: handle data result
|
// TODO: handle data result
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const resetToken = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const options: ClientOptions = {
|
const options: ClientOptions = {
|
||||||
url: apiBaseUrl,
|
url: apiBaseUrl + '/graphql',
|
||||||
maskTypename: true,
|
maskTypename: true,
|
||||||
requestPolicy: 'cache-and-network',
|
requestPolicy: 'cache-and-network',
|
||||||
fetchOptions: () => {
|
fetchOptions: () => {
|
||||||
|
|
|
@ -10,7 +10,7 @@ if (isDev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const options: ClientOptions = {
|
const options: ClientOptions = {
|
||||||
url: apiBaseUrl,
|
url: apiBaseUrl + '/graphql',
|
||||||
maskTypename: true,
|
maskTypename: true,
|
||||||
requestPolicy: 'cache-and-network',
|
requestPolicy: 'cache-and-network',
|
||||||
exchanges
|
exchanges
|
||||||
|
|
|
@ -7,6 +7,7 @@ export default gql`
|
||||||
messages {
|
messages {
|
||||||
author
|
author
|
||||||
body
|
body
|
||||||
|
replyTo
|
||||||
createdAt
|
createdAt
|
||||||
id
|
id
|
||||||
updatedAt
|
updatedAt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user