lastmjs
09/05/2017, 1:45 AMagartha
09/05/2017, 1:49 AMagartha
09/05/2017, 1:49 AMlastmjs
09/05/2017, 1:53 AMagartha
09/05/2017, 1:53 AMlastmjs
09/05/2017, 1:54 AMagartha
09/05/2017, 1:54 AMtype Link implements Node {
url: String
description: String
}
With permission only on url field;
And query:
query{
allLinks { url description }
}
I get:
{
"data": {
"allLinks": [
{
"url": "<http://test.com>",
"description": null
}
]
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 18
}
],
"path": [
"allLinks",
0,
"description"
],
"code": 3008,
"message": "Insufficient Permissions",
"requestId": "eu-west-1:simple:cj76y0kcezkhz0196djoow1ue"
}
]
}
If I use this schema:
type Link implements Node {
url: String!
description: String!
}
And run the same query, I get:
{
"data": null,
"errors": [
{
"locations": [
{
"line": 2,
"column": 18
}
],
"path": [
"allLinks",
0,
"description"
],
"code": 3008,
"message": "Insufficient Permissions",
"requestId": "eu-west-1:simple:cj76y1pr4zhse0139fbrz160o"
}
]
}
lastmjs
09/05/2017, 1:58 AMagartha
09/05/2017, 1:59 AMnull
is not a valid value for a required field, so it cannot be returned.agartha
09/05/2017, 2:01 AMagartha
09/05/2017, 2:03 AM