This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getMovies = `query GetMovies{ | |
getMovies(id: 0) { | |
id | |
name | |
poster | |
date | |
plot | |
} | |
} | |
`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const createResponse = (statusCode, content) => { | |
const body = JSON.stringify(content); | |
const response = { | |
"statusCode": statusCode, | |
"headers": { | |
"Access-Control-Allow-Origin": "*" | |
}, | |
"body": body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = new Vue({ | |
el: '#app', | |
data: { | |
message: "こんにちは", | |
userId: "", | |
displayName: "", | |
accessToken: "", | |
scope: "", | |
client_id: "", | |
expires_in: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="hello"> | |
<h1>{{ msg }}</h1> | |
<div class="section"> | |
<el-input type="text" v-model="input" auto-complete="off" style="width:80%;"></el-input> | |
</div> | |
<div class="section"> | |
<el-button type="button" @click="send">送信</el-button> | |
<el-button type="button" @click="disconnect">切断</el-button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import requests | |
from requests_aws4auth import AWS4Auth | |
def lambda_handler(event, context): | |
region_name = os.environ["REGION"] | |
app_name = os.environ["ENDPOINT"] | |
service = 'appsync-api' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('isomorphic-fetch'); | |
const AUTH_TYPE = require('aws-appsync/lib/link/auth-link').AUTH_TYPE; | |
const AWSAppSyncClient = require('aws-appsync').default; | |
const AmazonCognitoIdentity = require('amazon-cognito-identity-js'); | |
const gql = require('graphql-tag'); | |
const listMessages = gql(` | |
query getConversationMessages($conversationId: ID!, $after: String, $first: Int) { | |
allMessageConnection(conversationId: $conversationId, after: $after, first: $first) { | |
__typename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('isomorphic-fetch'); | |
const AUTH_TYPE = require('aws-appsync/lib/link/auth-link').AUTH_TYPE; | |
const AWSAppSyncClient = require('aws-appsync').default; | |
const gql = require('graphql-tag'); | |
const uuid = require('uuid/v4'); | |
const listMessages = gql(` | |
query getConversationMessages($conversationId: ID!, $after: String, $first: Int) { | |
allMessageConnection(conversationId: $conversationId, after: $after, first: $first) { | |
__typename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('isomorphic-fetch'); | |
const AUTH_TYPE = require('aws-appsync/lib/link/auth-link').AUTH_TYPE; | |
const AWSAppSyncClient = require('aws-appsync').default; | |
const gql = require('graphql-tag'); | |
const uuid = require('uuid/v4'); | |
const newMessage = gql(` | |
mutation createMessage($id: ID!, $content: String, $conversationId: ID!, $createdAt: String!) { | |
createMessage(id: $id, content: $content, conversationId: $conversationId, createdAt: $createdAt){ | |
__typename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Amplify from 'aws-amplify'; | |
import aws_exports from './aws-exports'; | |
import { withAuthenticator } from 'aws-amplify-react'; | |
import { I18n } from 'aws-amplify'; | |
Amplify.configure(aws_exports); | |
const dict = { | |
'ja': { | |
'User does not exist.': "ユーザー名またはパスワードが正しくありません", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handlers = { | |
'Messaging.MessageReceived': function() { | |
console.log("Messaging.MessageReceived", JSON.stringify(this.event)); | |
const message = this.event.request.message; | |
const apiAccessToken = this.event.context.System.apiAccessToken; | |
let date1 = new Date(); | |
date1.setMinutes(date1.getMinutes() + 30); |
NewerOlder