profile
viewpoint
Robert Zhu robzhu Amazon Web Services Boston, MA http://www.robzhu.com Works @AWS, previously @facebook (GraphQL), and @Microsoft (.net, Xbox)

robzhu/graphql-demo 63

Live-coding GraphQL demo

robzhu/graphql-hackathon 23

Repo for starter kits and samples for the GraphQL Community Hackathon

robzhu/credit-template 4

Template for generating printable AWS credits

raphaelmun/Xen 2

Xen (XNA Enhanced) - The Xen Framework is a set of libraries that provides and extends XNA 4.0 functionality to make game development easier and faster while producing clean, maintainable code. Xen frees you up to spend more time building your game.

robzhu/graphql-wg 2

Working group notes for GraphQL

robzhu/domain2LS 1

Instructions on how to use Lightsail to manage your DNS records for domains registered with domain.com

robzhu/express-starter 1

Starter kit for building an express/node app using babel for ES6 and await/async support.

robzhu/faq 1

GraphQL FAQ

PR opened graphql/graphql-wg

Update 2020-07-02.md
+1 -0

0 comment

1 changed file

pr created time in 7 days

push eventrobzhu/graphql-wg

Robert Zhu

commit sha f52396eb88c9024473ee8096457885562da5622b

Update 2020-07-02.md

view details

push time in 7 days

push eventrobzhu/ws-time

Robert Zhu

commit sha c4e48db7a577d70e13dac032d239cfe72feec82f

Fix typo

view details

push time in a month

push eventrobzhu/ws-time

Robert Zhu

commit sha 3d64b6e0286509ef92683616306df21fb01c7b6b

print name on start

view details

push time in a month

push eventrobzhu/ws-time

Robert Zhu

commit sha bacb50e2a540d12a9301d7167ca6e0baa6038526

Move client into public

view details

push time in a month

push eventrobzhu/ws-time

Robert Zhu

commit sha f3435792c7fd8fc5ca228e75cc78f76d677ba220

Initial checkin

view details

push time in a month

create barnchrobzhu/ws-time

branch : master

created branch time in a month

created repositoryrobzhu/ws-time

WebSockets demo for testing load balancers

created time in a month

push eventrobzhu/logged-out

Robert Zhu

commit sha 674c535f10c5e6ebbb8f0fa1efb299418abbbccb

Add demo GIF to README

view details

push time in 2 months

push eventrobzhu/logged-out

Robert Zhu

commit sha 9c13ebdeada13fac51e59d64f619299a78cc53e3

remove namespace

view details

push time in 2 months

push eventrobzhu/logged-out

Robert Zhu

commit sha 8d8c4b7b0eb2e7db6ae6f50957782a4f16efc5c4

Update README

view details

push time in 2 months

push eventrobzhu/logged-out

Robert Zhu

commit sha 74e00188a83bf66ccfd59f12a7b843ae085a31e3

Add example of native client

view details

push time in 2 months

push eventrobzhu/logged-out

Robert Zhu

commit sha eee7da52bee76336250c6a46f072d9d62d4c8acd

initial checkin

view details

push time in 2 months

create barnchrobzhu/logged-out

branch : master

created branch time in 2 months

created repositoryrobzhu/logged-out

Three ways to build real-time session invalidation

created time in 2 months

issue openedAPIs-guru/graphql-over-http

AWS AppSync HTTP behavior

@benjie @tinnou

The AppSync team is interested in participating in the HTTP specification. Here is the AppSync HTTP behavior:

AppSync supports HTTP POST and GET for queries and mutations. The URL for the endpoint is: https://<GUID>.appsync-api.<region>.amazonaws.com/graphql. Query variables are sent in the HTTP POST Body, encoded as JSON or as query parameters in HTTP GET.

Errors:

Empty request body: 400 w/ Response Body:

{
  "errors": [
    {
      "message": "Request body is empty.",
      "errorType": "MalformedHttpRequestException"
    }
  ]
}

Request body containing “meow” or “{}” or “{}}” or “[]”: 400 w/ Response Body:

{
  "errors": [
    {
      "message": "Unable to parse GraphQL query.",
      "errorType": "MalformedHttpRequestException"
    }
  ]
}

Request body containing “{badfield}” (invalid selection): 200 w/ Response Body:

{
    "data": null,
    "errors": [
        {
            "path": null,
            "locations": [
                {
                    "line": 1,
                    "column": 2,
                    "sourceName": null
                }
            ],
            "message": "Validation error of type FieldUndefined: Field 'badfield' in type 'Query' is undefined @ 'badfield'"
        }
    ]
}

Missing query variables: 200 w/ Response Body:

{
    "data": null,
    "errors": [
        {
            "path": null,
            "locations": [
                {
                    "line": 1,
                    "column": 23,
                    "sourceName": null
                }
            ],
            "message": "Variable 'name' has coerced Null value for NonNull type 'String!'"
        }
    ]
}

Missing operation name when there are multiple GraphQL documents in the request: 400 w/ Response Body:

{
  "errors": [
    {
      "errorType": "BadRequestException",
      "message": "Missing operation name."
    }
  ]
}

Mismatched variable type: 200 w/ Response Body:

{
    "data": null,
    "errors": [
        {
            "path": null,
            "locations": [
                {
                    "line": 3,
                    "column": 11,
                    "sourceName": null
                }
            ],
            "message": "Validation error of type VariableTypeMismatch: Variable type 'Boolean!' doesn't match expected type 'String!' @ 'createEvent'"
        }
    ]
}

Missing Schema definition (API exists):

~ » curl --verbose --location --request POST 'https://3wawwq467zfs7fztm7zbejd2zi.appsync-api.us-west-2.amazonaws.com/graphql' \ 
--header 'x-api-key: da2-4fg5zsayc5eyzoh7yebkq74h24     ' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query {\n    helloworld\n}","variables":{}}'

> POST /graphql HTTP/2
> Host: 3wawwq467zfs7fztm7zbejd2zi.appsync-api.us-west-2.amazonaws.com
> User-Agent: curl/7.54.0
> Accept: */*
> x-api-key: da2-4fg5zsayc5eyzoh7yebkq74h24
> Content-Type: application/json
> Content-Length: 53
>

< HTTP/2 502
< content-type: application/json;charset=UTF-8
< content-length: 117
< date: Mon, 13 Apr 2020 23:46:18 GMT
< x-amzn-requestid: 6b317af8-b592-4335-b607-d37cbf87e352
< x-amzn-errortype: GraphQLSchemaException
< x-cache: Error from cloudfront
< via: 1.1 9c60d6224ac0b44e908b5c9dcf70e9a5.cloudfront.net (CloudFront)
< x-amz-cf-pop: HIO50-C1
< x-amz-cf-id: ZYdVK8HL3O0a3miOztDcua7B9OZoxsO-updJhQJpFyG0gpszZSshwQ==
<
{
  "errors" : [ {
    "errorType" : "GraphQLSchemaException",
    "message" : "No schema definition exists."
  } ]
* Connection #0 to host 3wawwq467zfs7fztm7zbejd2zi.appsync-api.us-west-2.amazonaws.com left intact
}%

Example Mutation: (HTTP POST)

Headers:

:authority: 4oibmd5u5nahvhtdjy5zmm35oa.appsync-api.us-west-2.amazonaws.com
:method: POST
:path: /graphql
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 262
content-type: application/json
origin: https://us-west-2.console.aws.amazon.com
referer: https://us-west-2.console.aws.amazon.com/appsync/home?region=us-west-2
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
x-amz-user-agent: AWS-Console-AppSync/
x-api-key: <redacted>
Payload:
{"query":"mutation CreateEvent ($name: String!) {
  createEvent(
    name: $name
    when: "Today"
    where: "My House"
    description: "Very first event"
  ) {
    id
    name
  }
}
","variables":{"name":"test"},"operationName":"CreateEvent"}

Response Headers:

access-control-allow-origin: *
access-control-expose-headers: x-amzn-RequestId,x-amzn-ErrorType,x-amz-user-agent,x-amzn-ErrorMessage,Date,x-amz-schema-version
content-length: 84
content-type: application/json;charset=UTF-8
date: Mon, 13 Apr 2020 22:57:13 GMT
status: 200
via: 1.1 b4085435efbe95a420f374958bd145bf.cloudfront.net (CloudFront)
x-amz-cf-id: e4g9Byfo3dZD9w5PxM-NCU0IkG45x0ZWL7RiHuNok-NhFFX_oMRvwQ==
x-amz-cf-pop: SEA19-C1
x-amzn-requestid: 422c227f-a63a-4b18-bf28-c375255254de
x-cache: Miss from cloudfront

Response Body:

{"data":{"createEvent":{"id":"61b34b56-e699-4f82-af2e-10a5794a1bda","name":"test"}}}

Example Query: (HTTP POST)

Headers:

:authority: 4oibmd5u5nahvhtdjy5zmm35oa.appsync-api.us-west-2.amazonaws.com
:method: POST
:path: /graphql
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 153
content-type: application/json
origin: https://us-west-2.console.aws.amazon.com
referer: https://us-west-2.console.aws.amazon.com/appsync/home?region=us-west-2
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
x-amz-user-agent: AWS-Console-AppSync/
x-api-key: <redacted>
Payload:
{"query":"query ListEvents {
  listEvents {
    items {
      id
      name
    }
  }
}","variables":{"name":"test"},"operationName":"ListEvents"}

Response Headers:

access-control-allow-origin: *
access-control-expose-headers: x-amzn-RequestId,x-amzn-ErrorType,x-amz-user-agent,x-amzn-ErrorMessage,Date,x-amz-schema-version
content-length: 95
content-type: application/json;charset=UTF-8
date: Mon, 13 Apr 2020 22:53:28 GMT
status: 200
via: 1.1 b4085435efbe95a420f374958bd145bf.cloudfront.net (CloudFront)
x-amz-cf-id: mvkpGFwdSOXN200C1_CAvqP69cXrS6lnNyp6RACsj4pMX80hQV1G-w==
x-amz-cf-pop: SEA19-C1
x-amzn-requestid: 495458c1-c9af-484b-b60d-1a460c0a9605
x-cache: Miss from cloudfront

Response Body:

{"data":{"listEvents":{"items":[{"id":"61b34b56-e699-4f82-af2e-10a5794a1bda","name":"test"}]}}}

created time in 3 months

more