Skip to content

Instantly share code, notes, and snippets.

View weblabtechnology's full-sized avatar

Weblab weblabtechnology

View GitHub Profile
mutation {
createUser (name : “John”, username: ”jo123”){
name
username
}
}
{
Users (last: 3) {
name
username
}}
{
“Users”: [
{“name”: “Damira”},
{“name”: “Michael”}
{“name”: “Salman”}
{“name”: “Sara”}
{“name”: “Maria”}
]
}
{
Users {
name
}
}
query {
 users {
name
  education {
  degree
  year
  }
  age
  address {
  country
‘author_name’ => [
‘type’ => Type::string(),
  ‘deprecationReason’ => ‘Deprecated. Use author field’,
 ],
Request: query { books { error_field } }
Response:
Request Method:POST
Status Code: 200 OK
{“errors”:[{“message”:”Cannot query field \”error_field\” on type \”Book\”.”,”category”:”graphql”,”locations”:[{“line”:3,”column”:3}]}]}
query {
 books {
  title
  price
 } 
}
query {
  books {
  id
  title
  author
  isbn
  price
  } 
}
function f(arg1:number, arg2?:number) {
return arg1+arg2||0;
}
const res = f("hello", "world");