github.com/dgraph-io/dgraph@v1.2.8/graphql/e2e/common/error_test.yaml (about)

     1  -
     2    name: "Unknown root field"
     3    gqlrequest: |
     4      query {
     5        getAuthorszzz(id: "0x1") { name }
     6      }
     7    gqlvariables: 
     8      { }
     9    errors:
    10      [ { "message": "Cannot query field \"getAuthorszzz\" on type \"Query\". Did you mean
    11         \"getAuthor\"?",
    12        "locations": [ { "line": 2, "column": 3 } ] } ]
    13      
    14  -
    15    name: "Unknown field"
    16    gqlrequest: |
    17      query {
    18        getAuthor(id: "0x1") { namezzz }
    19      }
    20    gqlvariables: 
    21      { }
    22    errors:
    23      [ { "message": "Cannot query field \"namezzz\" on type \"Author\". Did you mean \"name\"?",
    24        "locations": [ { "line": 2, "column": 26 } ] } ]
    25  
    26  -
    27    name: "Undefined variable"
    28    gqlrequest: |
    29      query {
    30        getAuthor(id: $theID) { name }
    31      }
    32    gqlvariables: 
    33      { }
    34    errors:
    35      [ { "message": "Variable \"$theID\" is not defined.",
    36        "locations": [ { "line": 2, "column": 17 } ] } ]
    37  
    38  -
    39    name: "input of wrong type"
    40    gqlrequest: |
    41      query {
    42        queryAuthor(filter: { reputation: { le: "hi there" } }) { name }
    43      }
    44    gqlvariables: 
    45      { }
    46    errors:
    47      [ { "message": "Expected type Float, found \"hi there\".",
    48        "locations": [ { "line": 2, "column": 44 } ] } ]
    49  
    50  -
    51    name: "unknown variable type"
    52    gqlrequest: |
    53      query queryAuthor($filter: AuthorFiltarzzz!) {
    54        queryAuthor(filter: $filter) { name }
    55      }
    56    gqlvariables: 
    57      { "filter": "type was wrong" }
    58    errors:
    59      [ { "message": "Variable type provided AuthorFiltarzzz! is incompatible with expected
    60      type AuthorFilter",
    61        "locations": [{ "line": 2, "column": 23}]},
    62    { "message": "Variable \"$filter\" of type \"AuthorFiltarzzz!\" used in position
    63         expecting type \"AuthorFilter\".",
    64        "locations": [ { "line": 2, "column": 23 } ] },
    65        { "message": "Unknown type \"AuthorFiltarzzz\".",
    66        "locations": [ { "line": 1, "column": 1 } ] } ]
    67  
    68  -
    69    name: "variable of wrong type"
    70    gqlrequest: |
    71      query queryAuthor($filter: AuthorFilter!) {
    72        queryAuthor(filter: $filter) { name }
    73      }
    74    gqlvariables: 
    75      { "filter": 57 }
    76    errors:
    77      [ { "message": "must be defined",
    78        "path": [ "variable", "filter"] } ]
    79  
    80  -
    81    name: "variable field of wrong type"
    82    gqlrequest: |
    83      query queryAuthor($filter: AuthorFilter!) {
    84        queryAuthor(filter: $filter) { name }
    85      }
    86    gqlvariables: 
    87      { "filter": { "reputation": { le: "hi there" } } }
    88    errors:
    89      [ { "message": "must be defined",
    90        "path": [ "variable", "filter"] } ]