Async-graphql: Invalid error messages for scalar arrays

Created on 6 Nov 2020  路  3Comments  路  Source: async-graphql/async-graphql

Expected Behavior

Output 1 for fewReq: [DateTime!]! (should have trailing exclamation):

{
    "message": "Failed to parse \"DateTime\": trailing input (occurred while parsing \"[DateTime!]!\") (occurred while parsing \"TestInput\")",
}

Output 2 for fewOpt: [DateTime!] (should have no duplicates):

{
    "message": "Failed to parse \"DateTime\": trailing input (occurred while parsing \"[DateTime!]\") (occurred while parsing \"TestInput\")",
}

Actual Behavior

Output 1 for fewReq: [DateTime!]! (missing trailing exclamation):

{
    "message": "Failed to parse \"DateTime\": trailing input (occurred while parsing \"[DateTime!]\") (occurred while parsing \"TestInput\")",
}

Output 2 for fewOpt: [DateTime!] (duplicates):

{
    "message": "Failed to parse \"DateTime\": trailing input (occurred while parsing \"[DateTime!]\") (occurred while parsing \"[DateTime!]\") (occurred while parsing \"TestInput\")",
}

Steps to Reproduce the Problem

SDL and code:

input TestInput {
    fewReq: [DateTime!]!
    fewOpt: [DateTime!]
}

```rust

[derive(InputObject)]

pub struct TestInput {
few_req: Vec>,
few_opt: Option>>,
}


Query:
```gql
mutation Test($input: TestInput!) {
  test(input: $input)
}

Input 1:

{ 
  "input": { 
    "fewReq": ["2020-01-01T00:00:00+00:00err"],
    "fewOpt": ["2020-01-01T00:00:00+00:00"]
  } 
}

Input 2:

{ 
  "input": { 
    "fewReq": ["2020-01-01T00:00:00+00:00"],
    "fewOpt": ["2020-01-01T00:00:00+00:00err"]
  } 
}

Specifications

  • Version: 2.0.12
  • Platform: MacOS
bug

Most helpful comment

Should be fixed now with 9d94c93.

All 3 comments

@Koxiaet When you have a moment, would you please help me look at this problem? 馃檪

Should be fixed now with 9d94c93.

Should be fixed now with 9d94c93.

I don't want to sound boring but this fix is for the Output 2. In async-graphql 2.1.1 I have identical errors for both types [DateTime!]! (<-- trailing exclamation) and [DateTime!]. I don't think it's important, just my note.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhendrie91 picture dhendrie91  路  3Comments

servonlewis picture servonlewis  路  4Comments

Weasy666 picture Weasy666  路  4Comments

SirWindfield picture SirWindfield  路  4Comments

TsumiNa picture TsumiNa  路  5Comments