Atlex00Model
uid
, Type: ID, Required.first_name
: Type: Stringlast_name
: Type: Stringgender
: Type: Intage
: Type: Intemail
: Type: Emailuid
, Sort key: first_name
atlex00AppSync -> Queries
Click the play button and select listAtlex00Models
.
Result:
{
"data": {
"listAtlex00Models": {
"items": []
}
}
}
{
"createatlex00modelinput": {
"uid": "VbCqKXT5iqvT2Cv1ujThABuBt2Gn6I7x",
"first_name": "Atlex",
"last_name": "ID00",
"gender": 0,
"age": 29,
"email": "mymail@example.com"
}
}
createAtlex00Model
.{
"data": {
"createAtlex00Model": {
"uid": "VbCqKXT5iqvT2Cv1ujThABuBt2Gn6I7x",
"first_name": "Atlex",
"last_name": "ID00",
"gender": 0,
"age": 29,
"email": "mymail@example.com"
}
}
}
{
"createatlex00modelinput": {
"uid": "simpleuid",
"first_name": "Atlex2",
"last_name": "ID01",
"gender": 1,
"age": 30,
"email": "mymail2@example.com"
}
}
Click the play button and select createAtlex00Model
.
{
"data": {
"createAtlex00Model": {
"uid": "simpleuid",
"first_name": "Atlex2",
"last_name": "ID01",
"gender": 1,
"age": 30,
"email": "mymail2@example.com"
}
}
}
listAtlex00Models
.{
"data": {
"listAtlex00Models": {
"items": [
{
"uid": "VbCqKXT5iqvT2Cv1ujThABuBt2Gn6I7x",
"first_name": "Atlex",
"last_name": "ID00",
"gender": 0,
"age": 29,
"email": "mymail@example.com"
},
{
"uid": "simpleuid",
"first_name": "Atlex2",
"last_name": "ID01",
"gender": 1,
"age": 30,
"email": "mymail2@example.com"
}
]
}
}
}
Atlex00ModelTable
was created.uid
s are VbCqKXT5iqvT2Cv1ujThABuBt2Gn6I7x
and simpleuid
respectively.API URL
, API ID
and API Key
$ curl -H 'x-api-key: x-api-key:{{ My_API_Key }}' -d '{"query":"query {listMyModelTypes}"}' https://{{ My_API_URL_end_with_/graphql }} -vvv
* Trying 65.9.83.9:443...
* TCP_NODELAY set
* Connected to xxxxxxxxxxxxxxxxxx.appsync-api.eu-central-1.amazonaws.com (65.9.83.9) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=*.appsync-api.eu-central-1.amazonaws.com
* start date: Feb 5 00:00:00 2021 GMT
* expire date: Mar 6 23:59:59 2022 GMT
* subjectAltName: host "xxxxxxxxxxxxxxxxxxxxxxxxxx.appsync-api.eu-central-1.amazonaws.com" matched cert's "*.appsync-api.eu-central-1.amazonaws.com"
* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x564eba711800)
> POST /graphql HTTP/2
> Host: xxxxxxxxxxxxxxxxxxxxxxxxxx.appsync-api.eu-central-1.amazonaws.com
> user-agent: curl/7.68.0
> accept: */*
> x-api-key: x-api-key:{{ My_API_Key }}
> content-length: 36
> content-type: application/x-www-form-urlencoded
>
* We are completely uploaded and fine
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 401
< content-type: application/json;charset=UTF-8
< content-length: 129
< date: Sun, 28 Feb 2021 14:51:20 GMT
< x-amzn-requestid: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
< x-amzn-errortype: UnauthorizedException
< x-cache: Error from cloudfront
< via: 1.1 a06d82f018833bef3e7f2e9fd230e5ee.cloudfront.net (CloudFront)
< x-amz-cf-pop: AMS1-C1
< x-amz-cf-id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<
{
"errors" : [ {
"errorType" : "UnauthorizedException",
"message" : "You are not authorized to make this call."
} ]
* Connection #0 to host xxxxxxxxxxxxxxxxxxxxxxxxxx.appsync-api.eu-central-1.amazonaws.com left intact
https://forums.aws.amazon.com/thread.jspa?threadID=293189 I can’t access the URL directly…
Not tested from here. I shift to use from AWS Amplify integration.
I guess, I should configure CloudFront. https://aws.amazon.com/de/blogs/mobile/use-a-custom-domain-with-aws-appsync-amazon-cloudfront-and-amazon-route-53/
{{ API_URL_without_/graphql }}}
yourdomain.com
xxxxxxxx.cloudfront.net
Configure Route 53. CNAME record. The value is the domain.